Everything on refactoring.
4 articles tagged refactoring, sorted newest first.
PHP 8.6 Partial Function Application: Delete Half the Closures in Your Laravel App
PHP 8.6 lets you write str_replace(' ', '-', ?) and get a closure back. Here's what the ? and ... placeholders actually do, rewritten against real Laravel code, and where they bite.
Refactor Messy Conditionals with Laravel's Pipeline Facade
That forty-line filter() method full of nested ifs? Laravel's Pipeline facade turns it into small, swappable, individually testable stages — with a worked query-filter example.
First-Class Callable Syntax for Cleaner Laravel Collection Pipelines
Turn any method into a Closure with a trailing (...) for cleaner Laravel collection pipelines — and dodge the map() arity trap that silently corrupts your output.
Stop Looping: array_find, array_any and array_all in PHP 8.4
PHP 8.4 adds array_find, array_find_key, array_any and array_all — the readable way to search arrays and retire foreach-with-flag loops.