- we're not interested in private properties
[m6w6/ext-http] / scripts / check_docs.php
index 679e8caf6b2065911910344174ea1214f54685a0..fb6d9316a63e17c5846c3c2be3ce7f397d07e0dd 100755 (executable)
@@ -47,12 +47,18 @@ foreach ($ext->getClasses() as $class) {
                re($class->getName().".xml", "#>$name<#") or printf("\t%s::%s (%s)\n", $class->getName(), $name, $tmp);
        }
        foreach ($class->getProperties() as $prop) {
-               // blatant guess
-               re($class->getName().".xml", "#>{$prop->getName()}<#") or printf("\t%s::$%s\n", $class->getName(), $prop->getName());
+               /* @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) {
                /* @var $meth ReflectionMethod */
-               fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s::%s()\n", $class->getName(), $meth->getName());
+               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");
 }