Created
March 20, 2015 03:42
-
-
Save wgm89/1276d577c4bea531c970 to your computer and use it in GitHub Desktop.
Extension Reflection
This file contains hidden or 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 | |
| $e = new ReflectionExtension('gearman'); | |
| print "<?php\n\n// Gearman Version: " . $e->getVersion() . "\n\n"; | |
| foreach ($e->getClasses() as $c) { | |
| print 'class ' . $c->name . " {\n"; | |
| foreach ($c->getMethods() as $m) { | |
| print ' '; | |
| if ($m->isPublic()) { | |
| print 'public'; | |
| } elseif ($m->isProtected()) { | |
| print 'protected'; | |
| } elseif ($m->isPrivate()) { | |
| print 'private'; | |
| } | |
| print ' function ' . $m->name . '('; | |
| $sep = ''; | |
| foreach ($m->getParameters() as $p) { | |
| print $sep; | |
| $sep = ', '; | |
| if ($p->isOptional()) | |
| print '$' . $p->name . ' = null' ; | |
| else | |
| print '$' . $p->name; | |
| } | |
| print "){}\n"; | |
| } | |
| print "}\n\n"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment