Skip to content

Instantly share code, notes, and snippets.

@fd00
Created July 29, 2012 21:05
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 fd00/3201829 to your computer and use it in GitHub Desktop.
Save fd00/3201829 to your computer and use it in GitHub Desktop.
Map.php
public function each($function)
{
if (!is_callable($function)) {
throw new IllegalArgumentException('function must be callable');
}
foreach ($this->instance as $index => $key) {
$function($key, $this->instance[$key]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment