mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Merge pull request #740 from JeppeKnockaert/fix-cannot-redeclare-method
bugfix - Prevent redeclaring methods inside Aliases
This commit is contained in:
+5
-2
@@ -176,6 +176,10 @@ class Alias
|
||||
*/
|
||||
public function getMethods()
|
||||
{
|
||||
if (count($this->methods) > 0) {
|
||||
return $this->methods;
|
||||
}
|
||||
|
||||
$this->addMagicMethods();
|
||||
$this->detectMethods();
|
||||
return $this->methods;
|
||||
@@ -411,10 +415,9 @@ class Alias
|
||||
*/
|
||||
protected function removeDuplicateMethodsFromPhpDoc()
|
||||
{
|
||||
$methods = count($this->methods) > 0 ? $this->methods : $this->getMethods();
|
||||
$methodNames = array_map(function (Method $method) {
|
||||
return $method->getName();
|
||||
}, $methods);
|
||||
}, $this->getMethods());
|
||||
|
||||
foreach ($this->phpdoc->getTags() as $tag) {
|
||||
if ($tag instanceof MethodTag && in_array($tag->getMethodName(), $methodNames)) {
|
||||
|
||||
Reference in New Issue
Block a user