diff --git a/src/ProxyManager/Autoloader/Autoloader.php b/src/ProxyManager/Autoloader/Autoloader.php index 5308e638c..c28fc2c61 100644 --- a/src/ProxyManager/Autoloader/Autoloader.php +++ b/src/ProxyManager/Autoloader/Autoloader.php @@ -12,13 +12,8 @@ class Autoloader implements AutoloaderInterface { - protected FileLocatorInterface $fileLocator; - protected ClassNameInflectorInterface $classNameInflector; - - public function __construct(FileLocatorInterface $fileLocator, ClassNameInflectorInterface $classNameInflector) + public function __construct(protected FileLocatorInterface $fileLocator, protected ClassNameInflectorInterface $classNameInflector) { - $this->fileLocator = $fileLocator; - $this->classNameInflector = $classNameInflector; } public function __invoke(string $className): bool diff --git a/src/ProxyManager/Exception/InvalidProxiedClassException.php b/src/ProxyManager/Exception/InvalidProxiedClassException.php index 584b1c008..6209bc8c1 100644 --- a/src/ProxyManager/Exception/InvalidProxiedClassException.php +++ b/src/ProxyManager/Exception/InvalidProxiedClassException.php @@ -36,14 +36,10 @@ public static function abstractProtectedMethodsNotSupported(ReflectionClass $ref implode( "\n", array_map( - static function (ReflectionMethod $reflectionMethod): string { - return $reflectionMethod->getDeclaringClass()->getName() . '::' . $reflectionMethod->getName(); - }, + static fn (ReflectionMethod $reflectionMethod): string => $reflectionMethod->getDeclaringClass()->getName() . '::' . $reflectionMethod->getName(), array_filter( $reflection->getMethods(), - static function (ReflectionMethod $method): bool { - return $method->isAbstract() && $method->isProtected(); - } + static fn (ReflectionMethod $method): bool => $method->isAbstract() && $method->isProtected() ) ) ) diff --git a/src/ProxyManager/Exception/UnsupportedProxiedClassException.php b/src/ProxyManager/Exception/UnsupportedProxiedClassException.php index f0eda1e90..f8215cdec 100644 --- a/src/ProxyManager/Exception/UnsupportedProxiedClassException.php +++ b/src/ProxyManager/Exception/UnsupportedProxiedClassException.php @@ -36,9 +36,7 @@ public static function nonReferenceableLocalizedReflectionProperties( return new self(sprintf( 'Cannot create references for following properties of class %s: %s', $class->getName(), - implode(', ', array_map(static function (ReflectionProperty $property): string { - return $property->getName(); - }, $properties->getInstanceProperties())) + implode(', ', array_map(static fn (ReflectionProperty $property): string => $property->getName(), $properties->getInstanceProperties())) )); } } diff --git a/src/ProxyManager/Factory/AccessInterceptorScopeLocalizerFactory.php b/src/ProxyManager/Factory/AccessInterceptorScopeLocalizerFactory.php index e019e9d0c..648e7fa07 100644 --- a/src/ProxyManager/Factory/AccessInterceptorScopeLocalizerFactory.php +++ b/src/ProxyManager/Factory/AccessInterceptorScopeLocalizerFactory.php @@ -13,8 +13,6 @@ use ProxyManager\Signature\Exception\InvalidSignatureException; use ProxyManager\Signature\Exception\MissingSignatureException; -use function get_class; - /** * Factory responsible of producing proxy objects */ @@ -67,7 +65,7 @@ public function createProxy( array $prefixInterceptors = [], array $suffixInterceptors = [] ): AccessInterceptorInterface { - $proxyClassName = $this->generateProxy(get_class($instance)); + $proxyClassName = $this->generateProxy($instance::class); /** * We ignore type checks here, since `staticProxyConstructor` is not interfaced (by design) diff --git a/src/ProxyManager/Factory/AccessInterceptorValueHolderFactory.php b/src/ProxyManager/Factory/AccessInterceptorValueHolderFactory.php index 96cc66a35..d279ce430 100644 --- a/src/ProxyManager/Factory/AccessInterceptorValueHolderFactory.php +++ b/src/ProxyManager/Factory/AccessInterceptorValueHolderFactory.php @@ -15,8 +15,6 @@ use ProxyManager\Signature\Exception\InvalidSignatureException; use ProxyManager\Signature\Exception\MissingSignatureException; -use function get_class; - /** * Factory responsible of producing proxy objects */ @@ -69,7 +67,7 @@ public function createProxy( array $prefixInterceptors = [], array $suffixInterceptors = [] ): AccessInterceptorValueHolderInterface { - $proxyClassName = $this->generateProxy(get_class($instance)); + $proxyClassName = $this->generateProxy($instance::class); /** * We ignore type checks here, since `staticProxyConstructor` is not interfaced (by design) diff --git a/src/ProxyManager/Factory/NullObjectFactory.php b/src/ProxyManager/Factory/NullObjectFactory.php index 515cbbd78..c2e3d640e 100644 --- a/src/ProxyManager/Factory/NullObjectFactory.php +++ b/src/ProxyManager/Factory/NullObjectFactory.php @@ -12,7 +12,6 @@ use ProxyManager\Signature\Exception\InvalidSignatureException; use ProxyManager\Signature\Exception\MissingSignatureException; -use function get_class; use function is_object; /** @@ -45,7 +44,7 @@ public function __construct(?Configuration $configuration = null) */ public function createProxy(object|string $instanceOrClassName): NullObjectInterface { - $className = is_object($instanceOrClassName) ? get_class($instanceOrClassName) : $instanceOrClassName; + $className = is_object($instanceOrClassName) ? $instanceOrClassName::class : $instanceOrClassName; $proxyClassName = $this->generateProxy($className); /** diff --git a/src/ProxyManager/Factory/RemoteObject/Adapter/BaseAdapter.php b/src/ProxyManager/Factory/RemoteObject/Adapter/BaseAdapter.php index d343075f4..89c436137 100644 --- a/src/ProxyManager/Factory/RemoteObject/Adapter/BaseAdapter.php +++ b/src/ProxyManager/Factory/RemoteObject/Adapter/BaseAdapter.php @@ -14,24 +14,16 @@ */ abstract class BaseAdapter implements AdapterInterface { - protected Client $client; - - /** - * Service name mapping - * - * @var array - */ - protected array $map = []; - /** * Constructor * * @param array $map map of service names to their aliases */ - public function __construct(Client $client, array $map = []) - { - $this->client = $client; - $this->map = $map; + public function __construct( + protected Client $client, + // Service name mapping + protected array $map = [] + ) { } /** diff --git a/src/ProxyManager/Factory/RemoteObjectFactory.php b/src/ProxyManager/Factory/RemoteObjectFactory.php index 7bb1dc55f..86d654eee 100644 --- a/src/ProxyManager/Factory/RemoteObjectFactory.php +++ b/src/ProxyManager/Factory/RemoteObjectFactory.php @@ -13,7 +13,6 @@ use ProxyManager\Signature\Exception\InvalidSignatureException; use ProxyManager\Signature\Exception\MissingSignatureException; -use function get_class; use function is_object; /** @@ -21,20 +20,16 @@ */ class RemoteObjectFactory extends AbstractBaseFactory { - protected AdapterInterface $adapter; private ?RemoteObjectGenerator $generator; /** * {@inheritDoc} * - * @param AdapterInterface $adapter - * @param Configuration $configuration + * @param Configuration $configuration */ - public function __construct(AdapterInterface $adapter, ?Configuration $configuration = null) + public function __construct(protected AdapterInterface $adapter, ?Configuration $configuration = null) { parent::__construct($configuration); - - $this->adapter = $adapter; $this->generator = new RemoteObjectGenerator(); } @@ -54,7 +49,7 @@ public function __construct(AdapterInterface $adapter, ?Configuration $configura public function createProxy(string|object $instanceOrClassName): RemoteObjectInterface { $proxyClassName = $this->generateProxy( - is_object($instanceOrClassName) ? get_class($instanceOrClassName) : $instanceOrClassName + is_object($instanceOrClassName) ? $instanceOrClassName::class : $instanceOrClassName ); /** diff --git a/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php b/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php index a8334eb34..984af47e7 100644 --- a/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php +++ b/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php @@ -21,12 +21,10 @@ */ class FileWriterGeneratorStrategy implements GeneratorStrategyInterface { - protected FileLocatorInterface $fileLocator; private Closure $emptyErrorHandler; - public function __construct(FileLocatorInterface $fileLocator) + public function __construct(protected FileLocatorInterface $fileLocator) { - $this->fileLocator = $fileLocator; $this->emptyErrorHandler = static function (): void { }; } diff --git a/src/ProxyManager/Inflector/ClassNameInflector.php b/src/ProxyManager/Inflector/ClassNameInflector.php index 9f7ff3b0b..e56a97746 100644 --- a/src/ProxyManager/Inflector/ClassNameInflector.php +++ b/src/ProxyManager/Inflector/ClassNameInflector.php @@ -14,15 +14,13 @@ final class ClassNameInflector implements ClassNameInflectorInterface { - protected string $proxyNamespace; /** @var int @TODO annotation still needed for phpstan to understand this */ private int $proxyMarkerLength; private string $proxyMarker; private ParameterHasher $parameterHasher; - public function __construct(string $proxyNamespace) + public function __construct(protected string $proxyNamespace) { - $this->proxyNamespace = $proxyNamespace; $this->proxyMarker = '\\' . self::PROXY_MARKER . '\\'; $this->proxyMarkerLength = strlen($this->proxyMarker); $this->parameterHasher = new ParameterHasher(); diff --git a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGenerator.php b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGenerator.php index 5cbf9d8e6..6cb122152 100644 --- a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGenerator.php +++ b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGenerator.php @@ -67,9 +67,7 @@ public static function createInterceptedMethodBody( '{{$suffixInterceptorsName}}' => $suffixInterceptors->getName(), '{{$suffixEarlyReturnExpression}}' => ProxiedMethodReturnExpression::generate('$suffixReturnValue', $originalMethod), '{{$returnExpression}}' => ProxiedMethodReturnExpression::generate('$returnValue', $originalMethod), - '{{$paramsString}}' => 'array(' . implode(', ', array_map(static function (ParameterGenerator $parameter): string { - return var_export($parameter->getName(), true) . ' => $' . $parameter->getName(); - }, $method->getParameters())) . ')', + '{{$paramsString}}' => 'array(' . implode(', ', array_map(static fn (ParameterGenerator $parameter): string => var_export($parameter->getName(), true) . ' => $' . $parameter->getName(), $method->getParameters())) . ')', ]; return str_replace( diff --git a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php index b2bbc33a2..38e42d680 100644 --- a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php +++ b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php @@ -89,12 +89,10 @@ private function buildMethodInterceptor( MethodPrefixInterceptors $prefixInterceptors, MethodSuffixInterceptors $suffixInterceptors ): callable { - return static function (ReflectionMethod $method) use ($prefixInterceptors, $suffixInterceptors): InterceptedMethod { - return InterceptedMethod::generateMethod( - new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), - $prefixInterceptors, - $suffixInterceptors - ); - }; + return static fn (ReflectionMethod $method): InterceptedMethod => InterceptedMethod::generateMethod( + new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), + $prefixInterceptors, + $suffixInterceptors + ); } } diff --git a/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php b/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php index 7ac183f78..df416fcc4 100644 --- a/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php +++ b/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php @@ -128,13 +128,11 @@ private function buildMethodInterceptor( MethodSuffixInterceptors $suffixes, ValueHolderProperty $valueHolder ): callable { - return static function (ReflectionMethod $method) use ($prefixes, $suffixes, $valueHolder): InterceptedMethod { - return InterceptedMethod::generateMethod( - new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), - $valueHolder, - $prefixes, - $suffixes - ); - }; + return static fn (ReflectionMethod $method): InterceptedMethod => InterceptedMethod::generateMethod( + new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), + $valueHolder, + $prefixes, + $suffixes + ); } } diff --git a/src/ProxyManager/ProxyGenerator/Assertion/CanProxyAssertion.php b/src/ProxyManager/ProxyGenerator/Assertion/CanProxyAssertion.php index a129ba74f..bf30860e7 100644 --- a/src/ProxyManager/ProxyGenerator/Assertion/CanProxyAssertion.php +++ b/src/ProxyManager/ProxyGenerator/Assertion/CanProxyAssertion.php @@ -58,9 +58,7 @@ private static function hasNoAbstractProtectedMethods(ReflectionClass $originalC { $protectedAbstract = array_filter( $originalClass->getMethods(), - static function (ReflectionMethod $method): bool { - return $method->isAbstract() && $method->isProtected(); - } + static fn (ReflectionMethod $method): bool => $method->isAbstract() && $method->isProtected() ); if ($protectedAbstract) { diff --git a/src/ProxyManager/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializer.php b/src/ProxyManager/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializer.php index 493c212de..bcc1b00ed 100644 --- a/src/ProxyManager/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializer.php +++ b/src/ProxyManager/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializer.php @@ -113,10 +113,8 @@ private function getPropertyDefaultsAssignments(array $properties): string return implode( "\n", array_map( - function (ReflectionProperty $property): string { - return ' $instance->' . $property->getName() - . ' = ' . $this->getExportedPropertyDefaultValue($property) . ';'; - }, + fn (ReflectionProperty $property): string => ' $instance->' . $property->getName() + . ' = ' . $this->getExportedPropertyDefaultValue($property) . ';', $properties ) ); diff --git a/src/ProxyManager/ProxyGenerator/LazyLoadingGhost/MethodGenerator/SetProxyInitializer.php b/src/ProxyManager/ProxyGenerator/LazyLoadingGhost/MethodGenerator/SetProxyInitializer.php index f230050d2..54ed25625 100644 --- a/src/ProxyManager/ProxyGenerator/LazyLoadingGhost/MethodGenerator/SetProxyInitializer.php +++ b/src/ProxyManager/ProxyGenerator/LazyLoadingGhost/MethodGenerator/SetProxyInitializer.php @@ -4,6 +4,7 @@ namespace ProxyManager\ProxyGenerator\LazyLoadingGhost\MethodGenerator; +use Closure; use Laminas\Code\Generator\ParameterGenerator; use Laminas\Code\Generator\PropertyGenerator; use ProxyManager\Generator\MethodGenerator; @@ -21,7 +22,7 @@ public function __construct(PropertyGenerator $initializerProperty) { parent::__construct( 'setProxyInitializer', - [(new ParameterGenerator('initializer', 'Closure'))->setDefaultValue(null)], + [(new ParameterGenerator('initializer', Closure::class))->setDefaultValue(null)], self::FLAG_PUBLIC, '$this->' . $initializerProperty->getName() . ' = $initializer;' ); diff --git a/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php b/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php index c03f896d8..e6f2d0416 100644 --- a/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php +++ b/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php @@ -104,12 +104,10 @@ private function buildLazyLoadingMethodInterceptor( InitializerProperty $initializer, ValueHolderProperty $valueHolder ): callable { - return static function (ReflectionMethod $method) use ($initializer, $valueHolder): LazyLoadingMethodInterceptor { - return LazyLoadingMethodInterceptor::generateMethod( - new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), - $initializer, - $valueHolder - ); - }; + return static fn (ReflectionMethod $method): LazyLoadingMethodInterceptor => LazyLoadingMethodInterceptor::generateMethod( + new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), + $initializer, + $valueHolder + ); } } diff --git a/src/ProxyManager/ProxyGenerator/NullObject/MethodGenerator/StaticProxyConstructor.php b/src/ProxyManager/ProxyGenerator/NullObject/MethodGenerator/StaticProxyConstructor.php index e8f9d1eef..652b55222 100644 --- a/src/ProxyManager/ProxyGenerator/NullObject/MethodGenerator/StaticProxyConstructor.php +++ b/src/ProxyManager/ProxyGenerator/NullObject/MethodGenerator/StaticProxyConstructor.php @@ -30,9 +30,7 @@ public function __construct(ReflectionClass $originalClass) parent::__construct('staticProxyConstructor', [], self::FLAG_PUBLIC | self::FLAG_STATIC); $nullableProperties = array_map( - static function (ReflectionProperty $publicProperty): string { - return '$instance->' . $publicProperty->getName() . ' = null;'; - }, + static fn (ReflectionProperty $publicProperty): string => '$instance->' . $publicProperty->getName() . ' = null;', Properties::fromReflectionClass($originalClass) ->onlyNullableProperties() ->getPublicProperties() diff --git a/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php b/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php index 5f5617f5d..9e321c0da 100644 --- a/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php +++ b/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php @@ -62,13 +62,11 @@ static function (MethodGenerator $generatedMethod) use ($originalClass, $classGe }, array_merge( array_map( - static function (ReflectionMethod $method) use ($adapter, $originalClass): RemoteObjectMethod { - return RemoteObjectMethod::generateMethod( - new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), - $adapter, - $originalClass - ); - }, + static fn (ReflectionMethod $method): RemoteObjectMethod => RemoteObjectMethod::generateMethod( + new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), + $adapter, + $originalClass + ), ProxiedMethodsFilter::getProxiedMethods( $originalClass, ['__get', '__set', '__isset', '__unset'] diff --git a/src/ProxyManager/ProxyGenerator/Util/Properties.php b/src/ProxyManager/ProxyGenerator/Util/Properties.php index 1b6d9c26b..c512095dd 100644 --- a/src/ProxyManager/ProxyGenerator/Util/Properties.php +++ b/src/ProxyManager/ProxyGenerator/Util/Properties.php @@ -23,15 +23,11 @@ */ final class Properties { - /** @var ReflectionProperty[] */ - private array $properties; - /** * @param ReflectionProperty[] $properties */ - private function __construct(array $properties) + private function __construct(private array $properties) { - $this->properties = $properties; } public static function fromReflectionClass(ReflectionClass $reflection): self @@ -46,15 +42,11 @@ public static function fromReflectionClass(ReflectionClass $reflection): self } while ($class); return new self(array_merge( - ...array_map(static function (ReflectionClass $class): array { - return array_values(array_filter( - $class->getProperties(), - static function (ReflectionProperty $property) use ($class): bool { - return $class->getName() === $property->getDeclaringClass()->getName() - && ! $property->isStatic(); - } - )); - }, $parentClasses) + ...array_map(static fn (ReflectionClass $class): array => array_values(array_filter( + $class->getProperties(), + static fn (ReflectionProperty $property): bool => $class->getName() === $property->getDeclaringClass()->getName() + && ! $property->isStatic() + )), $parentClasses) )); } diff --git a/src/ProxyManager/ProxyGenerator/Util/ProxiedMethodsFilter.php b/src/ProxyManager/ProxyGenerator/Util/ProxiedMethodsFilter.php index 3094637f8..990ddd02a 100644 --- a/src/ProxyManager/ProxyGenerator/Util/ProxiedMethodsFilter.php +++ b/src/ProxyManager/ProxyGenerator/Util/ProxiedMethodsFilter.php @@ -63,12 +63,10 @@ private static function doFilter(ReflectionClass $class, array $excluded, bool $ return array_values(array_filter( $class->getMethods(ReflectionMethod::IS_PUBLIC), - static function (ReflectionMethod $method) use ($ignored, $requireAbstract): bool { - return (! $requireAbstract || $method->isAbstract()) && ! ( - array_key_exists(strtolower($method->getName()), $ignored) - || self::methodCannotBeProxied($method) - ); - } + static fn (ReflectionMethod $method): bool => (! $requireAbstract || $method->isAbstract()) && ! ( + array_key_exists(strtolower($method->getName()), $ignored) + || self::methodCannotBeProxied($method) + ) )); } diff --git a/src/ProxyManager/ProxyGenerator/Util/UnsetPropertiesGenerator.php b/src/ProxyManager/ProxyGenerator/Util/UnsetPropertiesGenerator.php index 39462ac03..c2e1e203f 100644 --- a/src/ProxyManager/ProxyGenerator/Util/UnsetPropertiesGenerator.php +++ b/src/ProxyManager/ProxyGenerator/Util/UnsetPropertiesGenerator.php @@ -91,9 +91,7 @@ private static function generateUnsetStatement(array $properties, string $instan . implode( ', ', array_map( - static function (ReflectionProperty $property) use ($instanceName): string { - return '$' . $instanceName . '->' . $property->getName(); - }, + static fn (ReflectionProperty $property): string => '$' . $instanceName . '->' . $property->getName(), $properties ) ) diff --git a/src/ProxyManager/ProxyGenerator/ValueHolder/MethodGenerator/Constructor.php b/src/ProxyManager/ProxyGenerator/ValueHolder/MethodGenerator/Constructor.php index 96d899da4..9dce2f352 100644 --- a/src/ProxyManager/ProxyGenerator/ValueHolder/MethodGenerator/Constructor.php +++ b/src/ProxyManager/ProxyGenerator/ValueHolder/MethodGenerator/Constructor.php @@ -60,9 +60,7 @@ private static function generateOriginalConstructorCall( . implode( ', ', array_map( - static function (ParameterReflection $parameter): string { - return ($parameter->isVariadic() ? '...' : '') . '$' . $parameter->getName(); - }, + static fn (ParameterReflection $parameter): string => ($parameter->isVariadic() ? '...' : '') . '$' . $parameter->getName(), $originalConstructor->getParameters() ) ) @@ -72,17 +70,13 @@ static function (ParameterReflection $parameter): string { private static function getConstructor(ReflectionClass $class): ?MethodReflection { $constructors = array_map( - static function (ReflectionMethod $method): MethodReflection { - return new MethodReflection( - $method->getDeclaringClass()->getName(), - $method->getName() - ); - }, + static fn (ReflectionMethod $method): MethodReflection => new MethodReflection( + $method->getDeclaringClass()->getName(), + $method->getName() + ), array_filter( $class->getMethods(), - static function (ReflectionMethod $method): bool { - return $method->isConstructor(); - } + static fn (ReflectionMethod $method): bool => $method->isConstructor() ) ); diff --git a/src/ProxyManager/Signature/ClassSignatureGenerator.php b/src/ProxyManager/Signature/ClassSignatureGenerator.php index 0fc4d6116..e558df73e 100644 --- a/src/ProxyManager/Signature/ClassSignatureGenerator.php +++ b/src/ProxyManager/Signature/ClassSignatureGenerator.php @@ -13,11 +13,8 @@ */ final class ClassSignatureGenerator implements ClassSignatureGeneratorInterface { - private SignatureGeneratorInterface $signatureGenerator; - - public function __construct(SignatureGeneratorInterface $signatureGenerator) + public function __construct(private SignatureGeneratorInterface $signatureGenerator) { - $this->signatureGenerator = $signatureGenerator; } /** diff --git a/src/ProxyManager/Signature/SignatureChecker.php b/src/ProxyManager/Signature/SignatureChecker.php index 5b38ad3db..a6f474163 100644 --- a/src/ProxyManager/Signature/SignatureChecker.php +++ b/src/ProxyManager/Signature/SignatureChecker.php @@ -16,11 +16,8 @@ */ final class SignatureChecker implements SignatureCheckerInterface { - private SignatureGeneratorInterface $signatureGenerator; - - public function __construct(SignatureGeneratorInterface $signatureGenerator) + public function __construct(private SignatureGeneratorInterface $signatureGenerator) { - $this->signatureGenerator = $signatureGenerator; } /**