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:
Stan Daniëls
2021-01-09 13:24:28 +01:00
committed by GitHub
parent 4f13ba85bd
commit fd30d1190d
4 changed files with 65 additions and 2 deletions
+5 -1
View File
@@ -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())