Fix missed helpers for abstract methods the same name but different classes

This commit is contained in:
Pavlo Zhukov
2018-10-01 00:02:03 +03:00
parent 593e0d4aa7
commit 5d8d93273f
4 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
//Method inherited from <?= $method->getDeclaringClass() ?> //Method inherited from <?= $method->getDeclaringClass() ?>
<?php endif; ?> <?php endif; ?>
<?= $method->shouldReturn() ? 'return ': '' ?><?= $method->getRoot() ?>::<?= $method->getName() ?>(<?= $method->getParams() ?>); <?= $method->shouldReturn() ? 'return ': '' ?><?= $method->getRoot() ?>::<?= $method->getRealName() ?>(<?= $method->getParams() ?>);
} }
<?php endforeach; ?> <?php endforeach; ?>
} }
+1 -1
View File
@@ -310,7 +310,7 @@ class Alias
$method = new \ReflectionMethod($className, $name); $method = new \ReflectionMethod($className, $name);
$class = new \ReflectionClass($className); $class = new \ReflectionClass($className);
if (!in_array($method->name, $this->usedMethods)) { if (!in_array($magic, $this->usedMethods)) {
if ($class !== $this->root) { if ($class !== $this->root) {
$this->methods[] = new Method($method, $this->alias, $class, $magic, $this->interfaces); $this->methods[] = new Method($method, $this->alias, $class, $magic, $this->interfaces);
} }
+1
View File
@@ -26,6 +26,7 @@ class Macro extends Method
$this->method = $method; $this->method = $method;
$this->interfaces = $interfaces; $this->interfaces = $interfaces;
$this->name = $methodName ?: $method->name; $this->name = $methodName ?: $method->name;
$this->real_name = $method->name;
$this->namespace = $class->getNamespaceName(); $this->namespace = $class->getNamespaceName();
//Create a DocBlock and serializer instance //Create a DocBlock and serializer instance
+12
View File
@@ -31,6 +31,7 @@ class Method
protected $params = array(); protected $params = array();
protected $params_with_default = array(); protected $params_with_default = array();
protected $interfaces = array(); protected $interfaces = array();
protected $real_name;
protected $return = null; protected $return = null;
/** /**
@@ -45,6 +46,7 @@ class Method
$this->method = $method; $this->method = $method;
$this->interfaces = $interfaces; $this->interfaces = $interfaces;
$this->name = $methodName ?: $method->name; $this->name = $methodName ?: $method->name;
$this->real_name = $method->name;
$this->namespace = $method->getDeclaringClass()->getNamespaceName(); $this->namespace = $method->getDeclaringClass()->getNamespaceName();
//Create a DocBlock and serializer instance //Create a DocBlock and serializer instance
@@ -112,6 +114,16 @@ class Method
return $this->name; return $this->name;
} }
/**
* Get the real method name
*
* @return string
*/
public function getRealName()
{
return $this->real_name;
}
/** /**
* Get the parameters for this method * Get the parameters for this method
* *