mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
15 lines
No EOL
592 B
Markdown
15 lines
No EOL
592 B
Markdown
---
|
|
title: 'You can refactor cluttered if () conditions using lookup tables, match statements, and switch statements'
|
|
tweet_id: '1471864664661311488'
|
|
thread_slug: weekly-thread-2021-01
|
|
author_username: archtechx
|
|
images:
|
|
- 'https://pbs.twimg.com/media/FGVrAKdVgAIWfwk.jpg'
|
|
created_at: 2021-12-17T15:27:36+00:00
|
|
slug: you-can-refactor-cluttered-if-conditions-using-lookup-tables-match-statements-and-switch-statements
|
|
---
|
|
🔥 Three ways you can refactor cluttered if () conditions
|
|
|
|
First: lookup tables 👇
|
|
|
|
These are great for refactoring complex conditions with lots of else if () cases |