diff --git a/resources/views/helper.php b/resources/views/helper.php index dee6278..d76952e 100644 --- a/resources/views/helper.php +++ b/resources/views/helper.php @@ -28,7 +28,7 @@ namespace { //Method inherited from getDeclaringClass() ?> - shouldReturn() ? 'return ': '' ?>getRoot() ?>::getName() ?>(getParams() ?>); + shouldReturn() ? 'return ': '' ?>getRoot() ?>::getRealName() ?>(getParams() ?>); } } diff --git a/src/Alias.php b/src/Alias.php index a7c5b70..22c14dc 100644 --- a/src/Alias.php +++ b/src/Alias.php @@ -310,7 +310,7 @@ class Alias $method = new \ReflectionMethod($className, $name); $class = new \ReflectionClass($className); - if (!in_array($method->name, $this->usedMethods)) { + if (!in_array($magic, $this->usedMethods)) { if ($class !== $this->root) { $this->methods[] = new Method($method, $this->alias, $class, $magic, $this->interfaces); } diff --git a/src/Macro.php b/src/Macro.php index 2d6081e..96ed968 100644 --- a/src/Macro.php +++ b/src/Macro.php @@ -26,6 +26,7 @@ class Macro extends Method $this->method = $method; $this->interfaces = $interfaces; $this->name = $methodName ?: $method->name; + $this->real_name = $method->name; $this->namespace = $class->getNamespaceName(); //Create a DocBlock and serializer instance diff --git a/src/Method.php b/src/Method.php index fd2dd65..8a5117d 100644 --- a/src/Method.php +++ b/src/Method.php @@ -31,6 +31,7 @@ class Method protected $params = array(); protected $params_with_default = array(); protected $interfaces = array(); + protected $real_name; protected $return = null; /** @@ -45,6 +46,7 @@ class Method $this->method = $method; $this->interfaces = $interfaces; $this->name = $methodName ?: $method->name; + $this->real_name = $method->name; $this->namespace = $method->getDeclaringClass()->getNamespaceName(); //Create a DocBlock and serializer instance @@ -112,6 +114,16 @@ class Method return $this->name; } + /** + * Get the real method name + * + * @return string + */ + public function getRealName() + { + return $this->real_name; + } + /** * Get the parameters for this method *