Skip to content

Instantly share code, notes, and snippets.

@ah01
Created September 3, 2010 21:56
Show Gist options
  • Save ah01/564636 to your computer and use it in GitHub Desktop.
Save ah01/564636 to your computer and use it in GitHub Desktop.
Generate yUML class diagram for all Exception classes in PHP
<?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
@ah01
Copy link
Author

ah01 commented Sep 3, 2010

And the result:

UML

http://yuml.me/4a7fe81e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment