Created
October 6, 2017 16:41
-
-
Save buiquangduc/1f62f84db923ac0e5bd59df8e90bbac3 to your computer and use it in GitHub Desktop.
Example of Reduce Complexity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// I'm pretty sure that We don't need to know the implementations to guess the return values | |
$person = App\Person::where('name', 'Duc')->first(); | |
// Return value will be the first person by the name Duc | |
$count = App\Flight::where('active', 1)->count(); | |
// Return value will be the number of active flight | |
$max = App\Flight::where('active', 1)->max('price'); | |
// Return value will be the number of the max flight price |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment