Last active
October 10, 2017 05:39
-
-
Save buiquangduc/764dba75561c326f611894b862f37e63 to your computer and use it in GitHub Desktop.
Routine with logical cohesion
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 | |
// Example of routine with logical cohesion | |
function update($name, $input) { | |
switch($name) { | |
case 'person': | |
// Stuff to update person with input data | |
break; | |
case 'car': | |
// Stuff to update car with input data | |
break; | |
case 'building': | |
// Stuff to update building with input data | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment