Created
October 7, 2017 14:27
-
-
Save buiquangduc/a756074cc795d6d9def80352adb18662 to your computer and use it in GitHub Desktop.
Routine introduce an intermediate, understandable abstraction
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 | |
$person = new Person(1); // Get the person with ID = 1 | |
// We will need to get the fullname of this person | |
// Replace these bunch of code | |
$firstName = $person->first_name; | |
$lastName = $person->last_name; | |
$fullName = $firstName.' '.$lastName; | |
// With | |
$fullName = getFullname($person); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment