Created
September 3, 2010 21:56
-
-
Save ah01/564636 to your computer and use it in GitHub Desktop.
Generate yUML class diagram for all Exception classes in PHP
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 | |
foreach (get_declared_classes() as $class) | |
{ | |
if(is_subclass_of($class, "Exception")) | |
{ | |
$parent = get_parent_class($class); | |
$color = in_array($class, spl_classes()) ? "{bg:lightblue}" : ""; | |
echo "[$parent]^-[$class$color]\n"; | |
} | |
} | |
// result: http://yuml.me/4b83e818 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run it online on http://www.ideone.com/tJRcJ !