Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -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(),
[]
);
}
}