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