diff --git a/src/Aop/Pointcut.php b/src/Aop/Pointcut.php index 5d40f4b3..2887855f 100644 --- a/src/Aop/Pointcut.php +++ b/src/Aop/Pointcut.php @@ -81,7 +81,7 @@ public function getKind(): int; */ public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool; diff --git a/src/Aop/Pointcut/AndPointcut.php b/src/Aop/Pointcut/AndPointcut.php index c1502655..4d998748 100644 --- a/src/Aop/Pointcut/AndPointcut.php +++ b/src/Aop/Pointcut/AndPointcut.php @@ -54,7 +54,7 @@ public function __construct(int $pointcutKind = null, Pointcut ...$pointcuts) public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/AttributePointcut.php b/src/Aop/Pointcut/AttributePointcut.php index b6feff14..2e6aaa3f 100644 --- a/src/Aop/Pointcut/AttributePointcut.php +++ b/src/Aop/Pointcut/AttributePointcut.php @@ -43,7 +43,7 @@ public function __construct( final public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/ClassInheritancePointcut.php b/src/Aop/Pointcut/ClassInheritancePointcut.php index df2b1644..b6f29997 100644 --- a/src/Aop/Pointcut/ClassInheritancePointcut.php +++ b/src/Aop/Pointcut/ClassInheritancePointcut.php @@ -33,7 +33,7 @@ public function __construct(private string $parentClassOrInterfaceName) {} public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/MagicMethodDynamicPointcut.php b/src/Aop/Pointcut/MagicMethodDynamicPointcut.php index 268ceb53..3c03f30f 100644 --- a/src/Aop/Pointcut/MagicMethodDynamicPointcut.php +++ b/src/Aop/Pointcut/MagicMethodDynamicPointcut.php @@ -50,7 +50,7 @@ public function __construct(private string $methodName) { public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/MatchInheritedPointcut.php b/src/Aop/Pointcut/MatchInheritedPointcut.php index 5d0adc07..23bcd3e2 100644 --- a/src/Aop/Pointcut/MatchInheritedPointcut.php +++ b/src/Aop/Pointcut/MatchInheritedPointcut.php @@ -28,7 +28,7 @@ final class MatchInheritedPointcut implements Pointcut { public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/ModifierPointcut.php b/src/Aop/Pointcut/ModifierPointcut.php index ee71b0e9..c6953e0d 100644 --- a/src/Aop/Pointcut/ModifierPointcut.php +++ b/src/Aop/Pointcut/ModifierPointcut.php @@ -54,7 +54,7 @@ public function __construct(int $initialMask = 0) */ public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/NamePointcut.php b/src/Aop/Pointcut/NamePointcut.php index 1f89d4ac..75549271 100644 --- a/src/Aop/Pointcut/NamePointcut.php +++ b/src/Aop/Pointcut/NamePointcut.php @@ -54,7 +54,7 @@ public function __construct( public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/NotPointcut.php b/src/Aop/Pointcut/NotPointcut.php index d217e90a..3453f6d7 100644 --- a/src/Aop/Pointcut/NotPointcut.php +++ b/src/Aop/Pointcut/NotPointcut.php @@ -34,7 +34,7 @@ public function __construct(private Pointcut $pointcut) {} */ public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/OrPointcut.php b/src/Aop/Pointcut/OrPointcut.php index c705d80e..57933eba 100644 --- a/src/Aop/Pointcut/OrPointcut.php +++ b/src/Aop/Pointcut/OrPointcut.php @@ -51,7 +51,7 @@ public function __construct(Pointcut ...$pointcuts) public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/PointcutReference.php b/src/Aop/Pointcut/PointcutReference.php index 34fd5675..bf04c01a 100644 --- a/src/Aop/Pointcut/PointcutReference.php +++ b/src/Aop/Pointcut/PointcutReference.php @@ -41,7 +41,7 @@ public function __construct( public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/ReturnTypePointcut.php b/src/Aop/Pointcut/ReturnTypePointcut.php index ff20f6f6..0479ee97 100644 --- a/src/Aop/Pointcut/ReturnTypePointcut.php +++ b/src/Aop/Pointcut/ReturnTypePointcut.php @@ -60,7 +60,7 @@ public function __construct(string $returnTypeName) public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): bool { diff --git a/src/Aop/Pointcut/TruePointcut.php b/src/Aop/Pointcut/TruePointcut.php index 1d74618b..7f5eb9c7 100644 --- a/src/Aop/Pointcut/TruePointcut.php +++ b/src/Aop/Pointcut/TruePointcut.php @@ -35,7 +35,7 @@ public function __construct(private int $pointcutKind = self::KIND_ALL) {} */ public function matches( ReflectionClass|ReflectionFileNamespace $context, - ReflectionMethod|ReflectionProperty|ReflectionFunction $reflector = null, + ReflectionMethod|ReflectionProperty|ReflectionFunction|null $reflector = null, object|string $instanceOrScope = null, array $arguments = null ): true { diff --git a/src/Instrument/ClassLoading/CacheWarmer.php b/src/Instrument/ClassLoading/CacheWarmer.php index e956568f..ff700bad 100644 --- a/src/Instrument/ClassLoading/CacheWarmer.php +++ b/src/Instrument/ClassLoading/CacheWarmer.php @@ -40,7 +40,7 @@ class CacheWarmer /** * CacheWarmer constructor. */ - public function __construct(AspectKernel $aspectKernel, OutputInterface $output = null) + public function __construct(AspectKernel $aspectKernel, ?OutputInterface $output = null) { $this->aspectKernel = $aspectKernel; $this->output = $output ?? new NullOutput(); diff --git a/src/Proxy/Part/InterceptedConstructorGenerator.php b/src/Proxy/Part/InterceptedConstructorGenerator.php index 985145a0..2da51301 100644 --- a/src/Proxy/Part/InterceptedConstructorGenerator.php +++ b/src/Proxy/Part/InterceptedConstructorGenerator.php @@ -35,8 +35,8 @@ final class InterceptedConstructorGenerator extends MethodGenerator */ public function __construct( array $interceptedProperties, - ReflectionMethod $constructor = null, - MethodGenerator $constructorGenerator = null, + ?ReflectionMethod $constructor = null, + ?MethodGenerator $constructorGenerator = null, bool $useTypeWidening = false ) { $constructorBody = count($interceptedProperties) > 0 ? $this->getConstructorBody($interceptedProperties) : '';