Skip to content

Instantly share code, notes, and snippets.

@buiquangduc
Last active October 10, 2017 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buiquangduc/764dba75561c326f611894b862f37e63 to your computer and use it in GitHub Desktop.
Save buiquangduc/764dba75561c326f611894b862f37e63 to your computer and use it in GitHub Desktop.
Routine with logical cohesion
<?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