Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Routine introduce an intermediate, understandable abstraction
<?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