Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed methods used from traits [#141]

  • Loading branch information...
commit 7b796e55261c2d673e949126f484c3fc527954b3 1 parent 41f4b1d
@Andrewsville Andrewsville authored
View
9 ApiGen/ReflectionClass.php
@@ -666,14 +666,13 @@ public function getUsedMethods()
{
$usedMethods = array();
foreach ($this->getMethods() as $method) {
- if (null === $method->getDeclaringTraitName()) {
+ if (null === $method->getDeclaringTraitName() || $this->getName() === $method->getDeclaringTraitName()) {
continue;
}
- if (null === $method->getOriginalName() || $method->getName() === $method->getOriginalName()) {
- $usedMethods[$method->getDeclaringTraitName()][$method->getName()]['method'] = $method;
- } else {
- $usedMethods[$method->getDeclaringTraitName()][$method->getOriginalName()]['aliases'][$method->getName()] = $method;
+ $usedMethods[$method->getDeclaringTraitName()][$method->getName()]['method'] = $method;
+ if (null !== $method->getOriginalName() && $method->getName() !== $method->getOriginalName()) {
+ $usedMethods[$method->getDeclaringTraitName()][$method->getName()]['aliases'][$method->getName()] = $method;
}
}
View
2  ApiGen/Template.php
@@ -477,7 +477,7 @@ public function getClassUrl($class)
public function getMethodUrl(ReflectionMethod $method, ReflectionClass $class = null)
{
$className = null !== $class ? $class->getName() : $method->getDeclaringClassName();
- return $this->getClassUrl($className) . '#_' . $method->getName();
+ return $this->getClassUrl($className) . '#_' . $method->getOriginalName();
}
/**
View
2  templates/default/class.latte
@@ -209,7 +209,7 @@ the file LICENSE.md that was distributed with this source code.
<tr>
<td><code>
{foreach $methods as $data}
- <a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->name}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}{sep}, {/sep}
+ <a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->originalName}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}{sep}, {/sep}
{/foreach}
</code></td>
</tr>
View
2  templates/frames/class.latte
@@ -209,7 +209,7 @@ the file LICENSE.md that was distributed with this source code.
<tr>
<td><code>
{foreach $methods as $data}
- <a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->name}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}{sep}, {/sep}
+ <a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->originalName}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}{sep}, {/sep}
{/foreach}
</code></td>
</tr>
Please sign in to comment.
Something went wrong with that request. Please try again.