SPATIE

  • Products
  • Open Source
  • Courses
  • Web Development
VacanciesAboutBlogDocsGuidelinesMerch ↗ Log in

Show me the code

  1. Introduction
  2. Marking a video as completed using Livewire Free
  3. Refactor complex conditionals Free
  4. Refactor if blocks to dedicated classes Free
  5. Controlling the flow of time Free
  6. Snapshot testing Free
  7. Using form requests Free
  8. Using suffixes Free
  9. Creating dedicated exception classes Free

Refactor if blocks to dedicated classes

If you code bases contains a long procedure with a lot of if statement to determine which case should be handle, consider extracting each case to its own dedicated class.


Previous: Refactor complex conditionals Next: Controlling the flow of time
  • Products
  • Open Source
  • Courses
  • Web Development
VacanciesAboutBlogDocsGuidelinesMerch ↗ Log in

Kruikstraat 22, Box 12
2018 Antwerp, Belgium
info@spatie.be
+32 3 292 56 79
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • Bluesky
  • Mastodon
  • YouTube
  • Privacy
  • Disclaimer

+32 3 292 56 79

Click to call us