X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=scripts%2Fcheck_docs.php;h=fb6d9316a63e17c5846c3c2be3ce7f397d07e0dd;hp=d65effa1ed37733d3417192c4f976dfc532375d2;hb=59a1d06f1498dd2aab19316b7f5405d76b4170e7;hpb=3837de728f09505d2bed811d0b26819ee719c3d9 diff --git a/scripts/check_docs.php b/scripts/check_docs.php index d65effa..fb6d931 100755 --- a/scripts/check_docs.php +++ b/scripts/check_docs.php @@ -4,7 +4,7 @@ function re($file, $re, &$m=NULL) { global $doc; - return preg_match($re, file_get_contents("$doc/$file"), $m); + return file_exists("$doc/$file") ? preg_match($re, file_get_contents("$doc/$file"), $m) : 0; } function fe($file) { global $doc; @@ -38,13 +38,27 @@ foreach ($ext->getFunctions() as $func) { } printf("\n"); -printf("Undocumented classes/methods:\n"); +printf("Undocumented classes/members:\n"); foreach ($ext->getClasses() as $class) { if (substr($class->getName(), -strlen("Exception")) === "Exception") continue; /* @var $class ReflectionClass */ fg(sprintf("%s.xml", $class->getName())) or printf(" %s\n", $class->getName()); + foreach ($class->getConstants() as $name => $tmp) { + re($class->getName().".xml", "#>$name<#") or printf("\t%s::%s (%s)\n", $class->getName(), $name, $tmp); + } + foreach ($class->getProperties() as $prop) { + /* @var $prop ReflectionProperty */ + $prop->isPrivate() or re($class->getName().".xml", "#>{$prop->getName()}<#") or printf("\t%s::$%s\n", $class->getName(), $prop->getName()); + } foreach ($class->getMethods() as $meth) { - fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s::%s()\n", $class->getName(), $meth->getName()); + /* @var $meth ReflectionMethod */ + try { + $meth->getPrototype(); + } catch (Exception $ex) { + // if getPrototype throws an exception it's definitely not a method declared in an interface + fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s::%s()\n", $class->getName(), $meth->getName()); + } + } printf("\n"); }