Category: PHP, javascript

A blog on PHP, JavaScript and more Amit Merchant · June 16, 2020 · ⋆ PHP There are a lot of ways to refactor the code but I want to talk about this little technique which doesn’t take lot of your thinking and makes your code look readable instantly.

While this code looks absolutely fine, there’s a room for improvement in it in terms of refactoring. If you check the condition in the placeOrder method, it checks for number of things in order to process the order further.

Follow me on Twitter @amit_merchant Refactor conditions to a method for better readability in PHP These new string functions are coming in PHP 8 Find the extension of files without extension in Laravel Non-capturing exception catches in PHP 8 Constructor Property Promotion in PHP 8
Newsletter

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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners