Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Routine introduce an intermediate, understandable abstraction
$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
You can’t perform that action at this time.