mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Fix issues with parsing invokable macros (#1124)
* Fix issues with parsing invokable macros * Add macro test # Conflicts: # tests/MacroTest.php
This commit is contained in:
+5
-1
@@ -65,7 +65,11 @@ class Macro extends Method
|
||||
|
||||
protected function addLocationToPhpDoc()
|
||||
{
|
||||
$enclosingClass = $this->method->getClosureScopeClass();
|
||||
if ($this->method->name === '__invoke') {
|
||||
$enclosingClass = $this->method->getDeclaringClass();
|
||||
} else {
|
||||
$enclosingClass = $this->method->getClosureScopeClass();
|
||||
}
|
||||
|
||||
/** @var \ReflectionMethod $enclosingMethod */
|
||||
$enclosingMethod = Collection::make($enclosingClass->getMethods())
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ class Method
|
||||
$this->initClassDefinedProperties($method, $class);
|
||||
|
||||
//Reference the 'real' function in the declaring class
|
||||
$this->root = '\\' . ltrim($class->getName(), '\\');
|
||||
$this->root = '\\' . ltrim($method->name === '__invoke' ? $method->getDeclaringClass()->getName() : $class->getName(), '\\');
|
||||
|
||||
//Create a DocBlock and serializer instance
|
||||
$this->initPhpDoc($method);
|
||||
|
||||
Reference in New Issue
Block a user