Aggiornato Composer
This commit is contained in:
@@ -11,10 +11,12 @@
|
||||
|
||||
namespace Carbon\PHPStan;
|
||||
|
||||
use PHPStan\Reflection\Assertions;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use PHPStan\Reflection\MethodReflection;
|
||||
use PHPStan\Reflection\MethodsClassReflectionExtension;
|
||||
use PHPStan\Reflection\Php\PhpMethodReflectionFactory;
|
||||
use PHPStan\Reflection\ReflectionProvider;
|
||||
use PHPStan\Type\TypehintHelper;
|
||||
|
||||
/**
|
||||
@@ -38,10 +40,13 @@ final class MacroExtension implements MethodsClassReflectionExtension
|
||||
* Extension constructor.
|
||||
*
|
||||
* @param PhpMethodReflectionFactory $methodReflectionFactory
|
||||
* @param ReflectionProvider $reflectionProvider
|
||||
*/
|
||||
public function __construct(PhpMethodReflectionFactory $methodReflectionFactory)
|
||||
{
|
||||
$this->scanner = new MacroScanner();
|
||||
public function __construct(
|
||||
PhpMethodReflectionFactory $methodReflectionFactory,
|
||||
ReflectionProvider $reflectionProvider
|
||||
) {
|
||||
$this->scanner = new MacroScanner($reflectionProvider);
|
||||
$this->methodReflectionFactory = $methodReflectionFactory;
|
||||
}
|
||||
|
||||
@@ -59,6 +64,7 @@ final class MacroExtension implements MethodsClassReflectionExtension
|
||||
public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection
|
||||
{
|
||||
$builtinMacro = $this->scanner->getMethod($classReflection->getName(), $methodName);
|
||||
$supportAssertions = class_exists(Assertions::class);
|
||||
|
||||
return $this->methodReflectionFactory->create(
|
||||
$classReflection,
|
||||
@@ -72,7 +78,11 @@ final class MacroExtension implements MethodsClassReflectionExtension
|
||||
$builtinMacro->isDeprecated()->yes(),
|
||||
$builtinMacro->isInternal(),
|
||||
$builtinMacro->isFinal(),
|
||||
$builtinMacro->getDocComment()
|
||||
$supportAssertions ? null : $builtinMacro->getDocComment(),
|
||||
$supportAssertions ? Assertions::createEmpty() : null,
|
||||
null,
|
||||
$builtinMacro->getDocComment(),
|
||||
[]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user