Skip to content

Instantly share code, notes, and snippets.

@gabrielmansour
Last active December 29, 2015 18:59
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 gabrielmansour/7714414 to your computer and use it in GitHub Desktop.
Save gabrielmansour/7714414 to your computer and use it in GitHub Desktop.
<?php
static function present($object){
$klass= ucfirst(preg_replace_callback('/_([a-z])/',
function($m) { return strtoupper($m[1]);},
$object->type)). 'Presenter';
return new $klass($object);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment