cvs: pear /QA_Peardoc_Coverage/QA/Peardoc Coverage.php

From: Date: Mon, 30 Oct 2006 18:18:58 +0000
Subject: cvs: pear /QA_Peardoc_Coverage/QA/Peardoc Coverage.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-42892@lists.php.net to get a copy of this message
cweiske Mon Oct 30 18:18:58 2006 UTC Modified files: /pear/QA_Peardoc_Coverage/QA/Peardoc Coverage.php Log: Sort classes in extendet report http://cvs.php.net/viewvc.cgi/pear/QA_Peardoc_Coverage/QA/Peardoc/Coverage.php?r1=1.3&r2=1.4&diff_format=u Index: pear/QA_Peardoc_Coverage/QA/Peardoc/Coverage.php diff -u pear/QA_Peardoc_Coverage/QA/Peardoc/Coverage.php:1.3 pear/QA_Peardoc_Coverage/QA/Peardoc/Coverage.php:1.4 --- pear/QA_Peardoc_Coverage/QA/Peardoc/Coverage.php:1.3 Mon Oct 30 15:00:32 2006 +++ pear/QA_Peardoc_Coverage/QA/Peardoc/Coverage.php Mon Oct 30 18:18:58 2006 @@ -411,52 +411,56 @@ $arDocClasses[$classElement->nodeValue] = true; } + $arClasses = array(); foreach ( QA_Peardoc_Coverage_ClassList::getFileList($strPackageDir) as $strClassFile ) { - $arClasses = QA_Peardoc_Coverage_MethodList::getMethods($strClassFile); - if (count($arClasses) == 0) { + $arClasses = array_merge( + $arClasses, + QA_Peardoc_Coverage_MethodList::getMethods($strClassFile) + ); + }//foreach file + + ksort($arClasses); + + foreach ($arClasses as $strClassName => $arMethods) { + if ($strClassName[0] == '*') { continue; } - foreach ($arClasses as $strClassName => $arMethods) { - if ($strClassName[0] == '*') { - continue; - } - //Check if class is documented - $strClassDocId = $strBaseId . '.' . strtolower(str_replace('_', '-', $strClassName)); + //Check if class is documented + $strClassDocId = $strBaseId . '.' . strtolower(str_replace('_', '-', $strClassName)); - if (!isset($arDocClasses[$strClassName]) && !$this->existsId($strClassDocId)) { - //FIXME: if classname is the same as package name -> short version - //class is not documented - $arDoc[$strClassName] = null; + if (!isset($arDocClasses[$strClassName]) && !$this->existsId($strClassDocId)) { + //FIXME: if classname is the same as package name -> short version + //class is not documented + $arDoc[$strClassName] = null; + continue; + } + + $arDocMethods = array(); + foreach ($baseElement->getElementsByTagName('function') as $funcElement) { + $arDocMethods[$funcElement->nodeValue] = true; + } + + //check if methods exist + foreach ($arMethods as $strMethod => $bDocBlock) { + //omit constructors + if ($strMethod == $strClassName || $strMethod == '__construct') { continue; } - $arDocMethods = array(); - foreach ($baseElement->getElementsByTagName('function') as $funcElement) { - $arDocMethods[$funcElement->nodeValue] = true; - } + if (isset($arDocMethods[$strMethod])) { + //first check if the method is in a <function> tag + $arDoc[$strClassName][$strMethod] = true; + } else { + //then check if the method has its own section + $strMethodDocId = $strClassDocId . '.' . strtolower(str_replace('_', '-', $strMethod)); - //check if methods exist - foreach ($arMethods as $strMethod => $bDocBlock) { - //omit constructors - if ($strMethod == $strClassName || $strMethod == '__construct') { - continue; - } - - if (isset($arDocMethods[$strMethod])) { - //first check if the method is in a <function> tag - $arDoc[$strClassName][$strMethod] = true; - } else { - //then check if the method has its own section - $strMethodDocId = $strClassDocId . '.' . strtolower(str_replace('_', '-', $strMethod)); - - $arDoc[$strClassName][$strMethod] = $this->existsId($strMethodDocId); - } - }//foreach method - }//foreach class - }//foreach file + $arDoc[$strClassName][$strMethod] = $this->existsId($strMethodDocId); + } + }//foreach method + }//foreach class return $arDoc; }//public function getPackageCoverage($strPackage, $strCategory, $strBaseId, $strPackageDir)

« previous php.pear.cvs (#42892) next »