Source: localheinz.com

Avoiding one-liners in PHP
PHP developers frequently share how they transform multiple lines of PHP code into one-liners. After all, writing PHP code is not a problem, but maintaining it is even more so.

Code coverage will decrease when you delete tests you reformat tested production code from more to fewer executable lines (one-liners, anyone?) you add untested code you reformat untested production code from fewer to more executable lines Code coverage will increase when you add tests you reformat tested production code from fewer to more executable lines you deleted untested production code you reformat untested production code from more to fewer executable lines (one-liners, anyone?) By using clever one-liners in your production code, you can gain misleadingly high confidence in your production code and your safety net of automated tests.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners