Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error where implemented interfaces that have not been parsed will ... #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions classes/classDoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,6 @@ function &interfaces()
{
return $this->_interfaces;
}

/** Return an interface in this class.
*
* @return ClassDoc
*/
function &interfaceNamed($interfaceName)
{
$return = NULL;
if (isset($this->_interfaces[$interfaceName])) {
$return =& $this->_interfaces[$interfaceName];
}
return $return;
}

/** Return true if this class is abstract.
*
Expand Down
7 changes: 2 additions & 5 deletions classes/phpDoctor.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,8 @@ function &parse()

case T_IMPLEMENTS:
// get implements clause
$interfaceName = $this->_getProgramElementName($tokens, $key);
$interface =& $rootDoc->classNamed($interfaceName);
if ($interface) {
$ce->set('interfaces', $interface);
}
$interfaceNames = $this->_getProgramElementName($tokens, $key);
$ce->set('interfaces', $interfaceNames);
break;

case T_THROW:
Expand Down
13 changes: 9 additions & 4 deletions doclets/debug/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function debug(&$rootDoc, $formatter)
echo '- Namespace ', $package->name(), "\n";
$this->fieldDoc($package->globals());
$this->methodDoc($package->functions());
$this->classDoc($package->allClasses());
$this->classDoc($package->allClasses(), $rootDoc);

}

Expand Down Expand Up @@ -149,7 +149,7 @@ function constructorDoc(&$constructor)
*
* @param ClassDoc[] classes
*/
function classDoc(&$classes)
function classDoc(&$classes, &$rootDoc)
{
$this->depth++;
if ($classes) {
Expand All @@ -172,8 +172,13 @@ function classDoc(&$classes)
$interfaces =& $class->interfaces();
if ($interfaces) {
echo ' implements ';
foreach($interfaces as $interface) {
echo $interface->packageName(), '\\', $interface->name(), ' ';
foreach($interfaces as $interfaceName) {
$interface = $rootDoc->classNamed($interfaceName);
if ($interface) {
echo $interface->packageName(), '\\', $interface->name(), ' ';
} else {
echo $interfaceName;
}
}
}
echo ' [', $class->location(), ']';
Expand Down
17 changes: 11 additions & 6 deletions doclets/standard/classWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,17 @@ function classWriter(&$doclet)
echo "<dl>\n";
echo "<dt>All Implemented Interfaces:</dt>\n";
echo '<dd>';
foreach ($implements as $interface) {
echo '<a href="', str_repeat('../', $this->_depth), $interface->asPath(), '">';
if ($interface->packageName() != $class->packageName()) {
echo $interface->packageName(), '\\';
}
echo $interface->name(), '</a> ';
foreach ($implements as $interfaceName) {
$interface = $rootDoc->classNamed($interfaceName);
if ($interface) {
echo '<a href="', str_repeat('../', $this->_depth), $interface->asPath(), '">';
if ($interface->packageName() != $class->packageName()) {
echo $interface->packageName(), '\\';
}
echo $interface->name(), '</a> ';
} else {
echo $interfaceName;
}
}
echo "</dd>\n";
echo "</dl>\n\n";
Expand Down