From 445a713c709d5f3d791955aae1ef9c50f3013474 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 10 Aug 2019 10:28:10 +0200 Subject: [PATCH 1/8] Disallow PHPUnit 8.3.0 due to https://github.com/sebastianbergmann/phpunit/issues/3772 As discussed with @sebastianbergmann, PHPUnit 8.3.4 may fix this issue, but until then, we lock onto an older version to have green builds to validate a release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 152a792ad..dbcf79e08 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ }, "require-dev": { "ext-phar": "*", - "phpunit/phpunit": "^8.2.2", + "phpunit/phpunit": "^8.2.2,<8.3.0", "squizlabs/php_codesniffer": "^3.4.2", "slevomat/coding-standard": "^5.0.4", "doctrine/coding-standard": "^6.0.0", From 4714f9eccdd4f7a784ba8e4eea2cc4e993a9797f Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 10 Aug 2019 11:04:16 +0200 Subject: [PATCH 2/8] Revert "Disallow PHPUnit 8.3.0 due to https://github.com/sebastianbergmann/phpunit/issues/3772" This reverts commit 445a713c709d5f3d791955aae1ef9c50f3013474. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dbcf79e08..152a792ad 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ }, "require-dev": { "ext-phar": "*", - "phpunit/phpunit": "^8.2.2,<8.3.0", + "phpunit/phpunit": "^8.2.2", "squizlabs/php_codesniffer": "^3.4.2", "slevomat/coding-standard": "^5.0.4", "doctrine/coding-standard": "^6.0.0", From ec707474c9006814338ac03657309d4746dc4633 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 10 Aug 2019 11:05:49 +0200 Subject: [PATCH 3/8] Remove usage of `@runTestsInSeparateProcesses` - drop testing around 'open_basedir' ini settings If you use `ini_set('open_basedir', ...)`, you are on your own, and you are really just hurting yourself. Stop relying on shared hosting, and deploy a proper isolated/virtualized environment if you got a real application. --- .../FileWriterGeneratorStrategyTest.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php b/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php index 5bc7ced19..276153d6b 100644 --- a/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php +++ b/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php @@ -4,7 +4,6 @@ namespace ProxyManagerTest\GeneratorStrategy; -use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use ProxyManager\Exception\FileNotWritableException; use ProxyManager\FileLocator\FileLocatorInterface; @@ -17,6 +16,7 @@ use function clearstatcache; use function decoct; use function fileperms; +use function ini_get; use function ini_set; use function is_dir; use function mkdir; @@ -24,15 +24,15 @@ use function scandir; use function strpos; use function sys_get_temp_dir; +use function tempnam; use function umask; use function uniqid; /** * Tests for {@see \ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy} * - * @group Coverage + * @group Coverage * @covers \ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy - * @runTestsInSeparateProcesses * * Note: this test generates temporary files that are not deleted */ @@ -42,13 +42,12 @@ final class FileWriterGeneratorStrategyTest extends TestCase protected function setUp() : void { - $this->tempDir = sys_get_temp_dir() . '/' . uniqid('FileWriterGeneratorStrategyTest', true); + parent::setUp(); - if (! is_dir($this->tempDir)) { - mkdir($this->tempDir); - } + $this->tempDir = tempnam(sys_get_temp_dir(), 'FileWriterGeneratorStrategyTest'); - ini_set('open_basedir', __DIR__ . '/../../..' . PATH_SEPARATOR . $this->tempDir); + unlink($this->tempDir); + mkdir($this->tempDir); } public function testGenerate() : void From ceee6b3f77b258371cb808479272c1213b7e94f1 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 10 Aug 2019 11:42:15 +0200 Subject: [PATCH 4/8] Removed untested `trim()` operation This particular `trim()` also cannot be tested, since a namespace containing a leading/trailing `T_NAMESPACE_SEPARATOR` would lead `zendframework/zend-code` to generate invalid code. This has to be fixed upstream, by using stricter types instead. --- .../GeneratorStrategy/FileWriterGeneratorStrategy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php b/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php index 5786ee13f..59737d9c7 100644 --- a/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php +++ b/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php @@ -45,7 +45,7 @@ public function __construct(FileLocatorInterface $fileLocator) */ public function generate(ClassGenerator $classGenerator) : string { - $className = trim($classGenerator->getNamespaceName(), '\\') + $className = $classGenerator->getNamespaceName() . '\\' . trim($classGenerator->getName(), '\\'); /** @var string $generatedCode */ $generatedCode = $classGenerator->generate(); From e98164d062b5bac8eed148ef2e0fadc0712201cf Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 10 Aug 2019 11:43:39 +0200 Subject: [PATCH 5/8] Removed untested `trim()` operation This particular `trim()` also cannot be tested, since a class containing a leading/trailing `T_NAMESPACE_SEPARATOR` would lead `zendframework/zend-code` to generate invalid code. This has to be fixed upstream, by using stricter types instead. --- .../GeneratorStrategy/FileWriterGeneratorStrategy.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php b/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php index 59737d9c7..b1e7f08ba 100644 --- a/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php +++ b/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php @@ -45,10 +45,9 @@ public function __construct(FileLocatorInterface $fileLocator) */ public function generate(ClassGenerator $classGenerator) : string { - $className = $classGenerator->getNamespaceName() - . '\\' . trim($classGenerator->getName(), '\\'); /** @var string $generatedCode */ $generatedCode = $classGenerator->generate(); + $className = $classGenerator->getNamespaceName() . '\\' . $classGenerator->getName(); $fileName = $this->fileLocator->getProxyFileName($className); set_error_handler($this->emptyErrorHandler); From ef182a9e3766e62941efde5c6ff5fbe17f0582bb Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 10 Aug 2019 11:53:04 +0200 Subject: [PATCH 6/8] Hardening tests around error handlers in `FileWriterGeneratorStrategy` --- .../FileWriterGeneratorStrategyTest.php | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php b/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php index 276153d6b..9205d1624 100644 --- a/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php +++ b/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php @@ -4,29 +4,27 @@ namespace ProxyManagerTest\GeneratorStrategy; +use Closure; use PHPUnit\Framework\TestCase; use ProxyManager\Exception\FileNotWritableException; use ProxyManager\FileLocator\FileLocatorInterface; use ProxyManager\Generator\ClassGenerator; use ProxyManager\Generator\Util\UniqueIdentifierGenerator; use ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy; -use const PATH_SEPARATOR; -use const SCANDIR_SORT_ASCENDING; use function class_exists; use function clearstatcache; use function decoct; use function fileperms; -use function ini_get; -use function ini_set; -use function is_dir; use function mkdir; use function rmdir; use function scandir; +use function set_error_handler; use function strpos; use function sys_get_temp_dir; use function tempnam; use function umask; use function uniqid; +use const SCANDIR_SORT_ASCENDING; /** * Tests for {@see \ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy} @@ -39,15 +37,30 @@ final class FileWriterGeneratorStrategyTest extends TestCase { private string $tempDir; + private Closure $originalErrorHandler; protected function setUp() : void { parent::setUp(); $this->tempDir = tempnam(sys_get_temp_dir(), 'FileWriterGeneratorStrategyTest'); + $this->originalErrorHandler = static function () { + throw new \ErrorException(); + }; unlink($this->tempDir); mkdir($this->tempDir); + set_error_handler($this->originalErrorHandler); + } + + protected function tearDown() : void + { + self::assertSame($this->originalErrorHandler, set_error_handler(static function () { + })); + restore_error_handler(); + restore_error_handler(); + + parent::tearDown(); } public function testGenerate() : void From a1ba576b8dd6859ba09fbbbcf3273e9ef97f524b Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 10 Aug 2019 12:02:46 +0200 Subject: [PATCH 7/8] Covering `Properties#withoutNonReferenceableProperties()` (deprecated) --- .../ProxyGenerator/Util/Properties.php | 2 ++ .../ProxyGenerator/Util/PropertiesTest.php | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/ProxyManager/ProxyGenerator/Util/Properties.php b/src/ProxyManager/ProxyGenerator/Util/Properties.php index 3dbee7d91..1d71e587f 100644 --- a/src/ProxyManager/ProxyGenerator/Util/Properties.php +++ b/src/ProxyManager/ProxyGenerator/Util/Properties.php @@ -102,6 +102,8 @@ public function onlyPropertiesThatCanBeUnset() : self /** * Properties that cannot be referenced are non-nullable typed properties that aren't initialised + * + * @deprecated no longer in use: please do not rely on this method */ public function withoutNonReferenceableProperties() : self { diff --git a/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php b/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php index 5bd634125..dd7a1a14e 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php @@ -421,4 +421,39 @@ public function propertiesToSkipFixture() : array ["\0ProxyManagerTestAsset\\ClassWithMixedProperties\0privateProperty0"], ]; } + + public function testWithoutNonReferenceableProperties() + { + $properties = Properties::fromReflectionClass(new ReflectionClass(ClassWithMixedTypedProperties::class)) + ->withoutNonReferenceableProperties() + ->getPublicProperties(); + + self::assertSame( + [ + 'publicUnTypedProperty', + 'publicUnTypedPropertyWithoutDefaultValue', + 'publicBoolProperty', + 'publicNullableBoolProperty', + 'publicNullableBoolPropertyWithoutDefaultValue', + 'publicIntProperty', + 'publicNullableIntProperty', + 'publicNullableIntPropertyWithoutDefaultValue', + 'publicFloatProperty', + 'publicNullableFloatProperty', + 'publicNullableFloatPropertyWithoutDefaultValue', + 'publicStringProperty', + 'publicNullableStringProperty', + 'publicNullableStringPropertyWithoutDefaultValue', + 'publicArrayProperty', + 'publicNullableArrayProperty', + 'publicNullableArrayPropertyWithoutDefaultValue', + 'publicIterableProperty', + 'publicNullableIterableProperty', + 'publicNullableIterablePropertyWithoutDefaultValue', + 'publicNullableObjectProperty', + 'publicNullableClassProperty', + ], + array_keys($properties) + ); + } } From 0e1ac25165e995cbbbe4130e1fb9b2589d14b51e Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 10 Aug 2019 12:10:05 +0200 Subject: [PATCH 8/8] Applied automatic CS fixes and fixing resulting static analysis issues --- .../Util/UniqueIdentifierGenerator.php | 1 - .../ProxyGenerator/Util/Properties.php | 2 - .../Util/UnsetPropertiesGenerator.php | 1 - ...ccessInterceptorValueHolderFactoryTest.php | 2 +- ...nterceptorScopeLocalizerFunctionalTest.php | 15 +++--- ...ssInterceptorValueHolderFunctionalTest.php | 12 ++--- .../FatalPreventionFunctionalTest.php | 4 +- .../LazyLoadingGhostFunctionalTest.php | 49 +++++++++++-------- .../LazyLoadingValueHolderFunctionalTest.php | 20 ++++---- .../Util/ClassGeneratorUtilsTest.php | 4 +- .../FileWriterGeneratorStrategyTest.php | 14 ++++-- .../AbstractProxyGeneratorTest.php | 1 - .../MethodGenerator/MagicCloneTest.php | 4 +- .../MethodGenerator/MagicGetTest.php | 4 +- .../MethodGenerator/MagicIssetTest.php | 4 +- .../MethodGenerator/MagicSetTest.php | 4 +- .../MethodGenerator/MagicSleepTest.php | 4 +- .../MethodGenerator/MagicUnsetTest.php | 4 +- .../Util/InterceptorGeneratorTest.php | 18 +++---- .../MethodGenerator/InterceptedMethodTest.php | 2 +- .../MethodGenerator/MagicCloneTest.php | 4 +- .../MethodGenerator/MagicGetTest.php | 6 +-- .../MethodGenerator/MagicIssetTest.php | 6 +-- .../MethodGenerator/MagicSetTest.php | 6 +-- .../MethodGenerator/MagicUnsetTest.php | 6 +-- .../StaticProxyConstructorTest.php | 6 +-- .../Util/InterceptorGeneratorTest.php | 24 ++++----- .../Assertion/CanProxyAssertionTest.php | 1 - .../MethodGenerator/CallInitializerTest.php | 4 +- .../MethodGenerator/InitializeProxyTest.php | 2 +- .../MethodGenerator/MagicCloneTest.php | 4 +- .../MethodGenerator/MagicSleepTest.php | 4 +- .../LazyLoadingMethodInterceptorTest.php | 4 +- .../MethodGenerator/MagicCloneTest.php | 2 +- .../MethodGenerator/MagicGetTest.php | 12 ++--- .../MethodGenerator/MagicIssetTest.php | 6 +-- .../MethodGenerator/MagicSetTest.php | 12 ++--- .../MethodGenerator/MagicSleepTest.php | 2 +- .../MethodGenerator/MagicUnsetTest.php | 12 ++--- .../MethodGenerator/MagicGetTest.php | 2 +- .../MethodGenerator/MagicIssetTest.php | 2 +- .../MethodGenerator/MagicSetTest.php | 2 +- .../MethodGenerator/MagicUnsetTest.php | 2 +- .../ProxyGenerator/Util/PropertiesTest.php | 3 +- .../Util/UnsetPropertiesGeneratorTest.php | 1 - .../MethodGenerator/MagicSleepTest.php | 2 +- 46 files changed, 157 insertions(+), 149 deletions(-) diff --git a/src/ProxyManager/Generator/Util/UniqueIdentifierGenerator.php b/src/ProxyManager/Generator/Util/UniqueIdentifierGenerator.php index 859c22b74..a7d00b716 100644 --- a/src/ProxyManager/Generator/Util/UniqueIdentifierGenerator.php +++ b/src/ProxyManager/Generator/Util/UniqueIdentifierGenerator.php @@ -21,7 +21,6 @@ abstract class UniqueIdentifierGenerator * Generates a valid unique identifier from the given name * * @psalm-return class-string - * * @psalm-suppress MoreSpecificReturnType */ public static function getIdentifier(string $name) : string diff --git a/src/ProxyManager/ProxyGenerator/Util/Properties.php b/src/ProxyManager/ProxyGenerator/Util/Properties.php index 1d71e587f..3dbee7d91 100644 --- a/src/ProxyManager/ProxyGenerator/Util/Properties.php +++ b/src/ProxyManager/ProxyGenerator/Util/Properties.php @@ -102,8 +102,6 @@ public function onlyPropertiesThatCanBeUnset() : self /** * Properties that cannot be referenced are non-nullable typed properties that aren't initialised - * - * @deprecated no longer in use: please do not rely on this method */ public function withoutNonReferenceableProperties() : self { diff --git a/src/ProxyManager/ProxyGenerator/Util/UnsetPropertiesGenerator.php b/src/ProxyManager/ProxyGenerator/Util/UnsetPropertiesGenerator.php index 09863ba3b..d55844cc9 100644 --- a/src/ProxyManager/ProxyGenerator/Util/UnsetPropertiesGenerator.php +++ b/src/ProxyManager/ProxyGenerator/Util/UnsetPropertiesGenerator.php @@ -17,7 +17,6 @@ */ final class UnsetPropertiesGenerator { - /** @var string */ private const CLOSURE_TEMPLATE = <<<'PHP' \Closure::bind(function (\%s $instance) { %s diff --git a/tests/ProxyManagerTest/Factory/AccessInterceptorValueHolderFactoryTest.php b/tests/ProxyManagerTest/Factory/AccessInterceptorValueHolderFactoryTest.php index 5279295c4..b79007c3a 100644 --- a/tests/ProxyManagerTest/Factory/AccessInterceptorValueHolderFactoryTest.php +++ b/tests/ProxyManagerTest/Factory/AccessInterceptorValueHolderFactoryTest.php @@ -186,7 +186,7 @@ static function (ClassGenerator $targetClass) use ($proxyClassName) : bool { self::fail('Not supposed to be called'); }, ]; - $proxy = $factory->createProxy($instance, $prefixInterceptors, $suffixInterceptors); + $proxy = $factory->createProxy($instance, $prefixInterceptors, $suffixInterceptors); self::assertInstanceOf($proxyClassName, $proxy); self::assertSame($instance, $proxy->instance); diff --git a/tests/ProxyManagerTest/Functional/AccessInterceptorScopeLocalizerFunctionalTest.php b/tests/ProxyManagerTest/Functional/AccessInterceptorScopeLocalizerFunctionalTest.php index 448f0080c..11b2eb20e 100644 --- a/tests/ProxyManagerTest/Functional/AccessInterceptorScopeLocalizerFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/AccessInterceptorScopeLocalizerFunctionalTest.php @@ -26,6 +26,7 @@ use ReflectionClass; use stdClass; use function array_values; +use function get_class; use function random_int; use function serialize; use function uniqid; @@ -268,8 +269,8 @@ public function testPropertyUnset(object $instance, AccessInterceptorInterface $ */ public function testCanWriteToArrayKeysInPublicProperty() : void { - $instance = new ClassWithPublicArrayPropertyAccessibleViaMethod(); - $proxy = (new AccessInterceptorScopeLocalizerFactory())->createProxy($instance); + $instance = new ClassWithPublicArrayPropertyAccessibleViaMethod(); + $proxy = (new AccessInterceptorScopeLocalizerFactory())->createProxy($instance); $proxy->arrayProperty['foo'] = 'bar'; @@ -287,8 +288,8 @@ public function testCanWriteToArrayKeysInPublicProperty() : void */ public function testWillNotModifyRetrievedPublicProperties() : void { - $instance = new ClassWithPublicProperties(); - $proxy = (new AccessInterceptorScopeLocalizerFactory())->createProxy($instance); + $instance = new ClassWithPublicProperties(); + $proxy = (new AccessInterceptorScopeLocalizerFactory())->createProxy($instance); $variable = $proxy->property0; @@ -308,8 +309,8 @@ public function testWillNotModifyRetrievedPublicProperties() : void */ public function testWillModifyByRefRetrievedPublicProperties() : void { - $instance = new ClassWithPublicProperties(); - $proxy = (new AccessInterceptorScopeLocalizerFactory())->createProxy($instance); + $instance = new ClassWithPublicProperties(); + $proxy = (new AccessInterceptorScopeLocalizerFactory())->createProxy($instance); $variable = &$proxy->property0; @@ -403,7 +404,7 @@ public static function getProxyMethods() : array */ public function getPropertyAccessProxies() : array { - $instance = new BaseClass(); + $instance = new BaseClass(); return [ [ diff --git a/tests/ProxyManagerTest/Functional/AccessInterceptorValueHolderFunctionalTest.php b/tests/ProxyManagerTest/Functional/AccessInterceptorValueHolderFunctionalTest.php index 7d8dd852c..adf18e5ca 100644 --- a/tests/ProxyManagerTest/Functional/AccessInterceptorValueHolderFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/AccessInterceptorValueHolderFunctionalTest.php @@ -273,8 +273,8 @@ public function testPropertyUnset( */ public function testCanWriteToArrayKeysInPublicProperty() : void { - $instance = new ClassWithPublicArrayPropertyAccessibleViaMethod(); - $proxy = (new AccessInterceptorValueHolderFactory())->createProxy($instance); + $instance = new ClassWithPublicArrayPropertyAccessibleViaMethod(); + $proxy = (new AccessInterceptorValueHolderFactory())->createProxy($instance); $proxy->arrayProperty['foo'] = 'bar'; @@ -290,7 +290,7 @@ public function testCanWriteToArrayKeysInPublicProperty() : void */ public function testWillNotModifyRetrievedPublicProperties() : void { - $instance = new ClassWithPublicProperties(); + $instance = new ClassWithPublicProperties(); $proxy = (new AccessInterceptorValueHolderFactory())->createProxy($instance); $variable = $proxy->property0; @@ -307,7 +307,7 @@ public function testWillNotModifyRetrievedPublicProperties() : void */ public function testWillModifyByRefRetrievedPublicProperties() : void { - $instance = new ClassWithPublicProperties(); + $instance = new ClassWithPublicProperties(); $proxy = (new AccessInterceptorValueHolderFactory())->createProxy($instance); $variable = &$proxy->property0; @@ -468,8 +468,8 @@ public function getProxyMethods() : array */ public function getPropertyAccessProxies() : array { - $instance1 = new BaseClass(); - $instance2 = new BaseClass(); + $instance1 = new BaseClass(); + $instance2 = new BaseClass(); /** @var AccessInterceptorValueHolderInterface $serialized */ $serialized = unserialize(serialize((new AccessInterceptorValueHolderFactory())->createProxy($instance2))); diff --git a/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php b/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php index 00cfdc021..b222fb857 100644 --- a/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php @@ -50,8 +50,8 @@ final class FatalPreventionFunctionalTest extends TestCase */ public function testCodeGeneration(string $generatorClass, string $className) : void { - $generatedClass = new ClassGenerator(uniqid('generated', true)); - $generatorStrategy = new EvaluatingGeneratorStrategy(); + $generatedClass = new ClassGenerator(uniqid('generated', true)); + $generatorStrategy = new EvaluatingGeneratorStrategy(); $classGenerator = new $generatorClass(); $classSignatureGenerator = new ClassSignatureGenerator(new SignatureGenerator()); diff --git a/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php b/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php index fcf8f391b..7cb93bf00 100644 --- a/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php @@ -169,7 +169,7 @@ public function testMethodCallsAfterCloning( array $params, $expectedValue ) : void { - $proxy = (new LazyLoadingGhostFactory())->createProxy( + $proxy = (new LazyLoadingGhostFactory())->createProxy( $className, $this->createInitializer($className, $instance) ); @@ -438,7 +438,7 @@ static function ( ?Closure & $initializer, array $properties ) : bool { - $initializer = null; + $initializer = null; $properties["\0" . ClassWithCollidingPrivateInheritedProperties::class . "\0property0"] = 'foo'; $properties["\0" . get_parent_class(ClassWithCollidingPrivateInheritedProperties::class) . "\0property0"] = 'bar'; @@ -820,7 +820,6 @@ public function testInitializeProxyWillReturnTrueOnSuccessfulInitialization() : /** * @psalm-param (CallableInterface&Mock)|null $initializerMatcher - * * @psalm-return Closure( * GhostObjectInterface $proxy, * string $method, @@ -990,8 +989,8 @@ public function getProxyNonInitializingMethods() : array */ public function getPropertyAccessProxies() : array { - $instance1 = new BaseClass(); - $instance2 = new BaseClass(); + $instance1 = new BaseClass(); + $instance2 = new BaseClass(); $factory = new LazyLoadingGhostFactory(); @@ -1219,7 +1218,10 @@ static function ( array $params, ?Closure & $initializer, array $properties - ) use ($propertyIndex, $expectedValue) : bool { + ) use ( + $propertyIndex, + $expectedValue + ) : bool { $initializer = null; $properties[$propertyIndex] = $expectedValue; @@ -1251,20 +1253,24 @@ public function testWillAccessMembersOfOtherDeSerializedProxiesWithTheSamePrivat $proxy = unserialize(serialize( (new LazyLoadingGhostFactory())->createProxy( OtherObjectAccessClass::class, - static function ( - GhostObjectInterface$proxy, - string $method, - array $params, - ?Closure & $initializer, - array $properties - ) use ($propertyIndex, $expectedValue) : bool { - $initializer = null; + static function ( + GhostObjectInterface $proxy, + string $method, + array $params, + ?Closure & $initializer, + array $properties + ) use ( + $propertyIndex, + $expectedValue + ) : bool { + $initializer = null; + + $properties[$propertyIndex] = $expectedValue; - $properties[$propertyIndex] = $expectedValue; - - return true; - } - ))); + return true; + } + ) + )); $accessor = [$callerObject, $method]; @@ -1292,7 +1298,10 @@ static function ( array $params, ?Closure & $initializer, array $properties - ) use ($propertyIndex, $expectedValue) : bool { + ) use ( + $propertyIndex, + $expectedValue + ) : bool { $initializer = null; $properties[$propertyIndex] = $expectedValue; diff --git a/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php b/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php index 64e97b68f..7c4d19f29 100644 --- a/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php @@ -125,7 +125,7 @@ public function testMethodCallsAfterCloning( array $params, $expectedValue ) : void { - $proxy = (new LazyLoadingValueHolderFactory())->createProxy( + $proxy = (new LazyLoadingValueHolderFactory())->createProxy( $className, $this->createInitializer($className, $instance) ); @@ -236,7 +236,7 @@ public function testCanWriteToArrayKeysInPublicProperty() : void */ public function testWillNotModifyRetrievedPublicProperties() : void { - $proxy = (new LazyLoadingValueHolderFactory())->createProxy( + $proxy = (new LazyLoadingValueHolderFactory())->createProxy( ClassWithPublicProperties::class, $this->createInitializer(ClassWithPublicProperties::class, new ClassWithPublicProperties()) ); @@ -255,7 +255,7 @@ public function testWillNotModifyRetrievedPublicProperties() : void */ public function testWillModifyByRefRetrievedPublicProperties() : void { - $proxy = (new LazyLoadingValueHolderFactory())->createProxy( + $proxy = (new LazyLoadingValueHolderFactory())->createProxy( ClassWithPublicProperties::class, $this->createInitializer(ClassWithPublicProperties::class, new ClassWithPublicProperties()) ); @@ -276,7 +276,7 @@ public function testWillModifyByRefRetrievedPublicProperties() : void */ public function testWillAllowMultipleProxyInitialization() : void { - $counter = 0; + $counter = 0; $proxy = (new LazyLoadingValueHolderFactory())->createProxy( BaseClass::class, @@ -375,8 +375,6 @@ static function (?object & $wrappedInstance) : bool { } /** - * @psalm-param (CallableInterface&Mock)|null $initializerMatcher - * * @return Closure( * object|null, * VirtualProxyInterface, @@ -384,6 +382,8 @@ static function (?object & $wrappedInstance) : bool { * array, * ?Closure * ) : bool + * + * @psalm-param (CallableInterface&Mock)|null $initializerMatcher */ private function createInitializer(string $className, object $realInstance, ?Mock $initializerMatcher = null) : Closure { @@ -534,9 +534,9 @@ public function getProxyMethods() : array */ public function getPropertyAccessProxies() : array { - $instance1 = new BaseClass(); - $instance2 = new BaseClass(); - $factory = new LazyLoadingValueHolderFactory(); + $instance1 = new BaseClass(); + $instance2 = new BaseClass(); + $factory = new LazyLoadingValueHolderFactory(); /** @var VirtualProxyInterface $serialized */ $serialized = unserialize(serialize($factory->createProxy( BaseClass::class, @@ -598,7 +598,7 @@ public function testWillFetchMembersOfOtherDeSerializedProxiesWithTheSamePrivate ) : void { $className = get_class($realInstance); /** @var LazyLoadingInterface $proxy */ - $proxy = unserialize(serialize((new LazyLoadingValueHolderFactory())->createProxy( + $proxy = unserialize(serialize((new LazyLoadingValueHolderFactory())->createProxy( $className, $this->createInitializer($className, $realInstance) ))); diff --git a/tests/ProxyManagerTest/Generator/Util/ClassGeneratorUtilsTest.php b/tests/ProxyManagerTest/Generator/Util/ClassGeneratorUtilsTest.php index 10026e660..d7977e883 100644 --- a/tests/ProxyManagerTest/Generator/Util/ClassGeneratorUtilsTest.php +++ b/tests/ProxyManagerTest/Generator/Util/ClassGeneratorUtilsTest.php @@ -23,7 +23,7 @@ final class ClassGeneratorUtilsTest extends TestCase { public function testCantAddAFinalMethod() : void { - $classGenerator = $this->createMock(ClassGenerator::class); + $classGenerator = $this->createMock(ClassGenerator::class); $methodGenerator = $this->createMock(MethodGenerator::class); $methodGenerator @@ -42,7 +42,7 @@ public function testCantAddAFinalMethod() : void public function testCanAddANotFinalMethod() : void { - $classGenerator = $this->createMock(ClassGenerator::class); + $classGenerator = $this->createMock(ClassGenerator::class); $methodGenerator = $this->createMock(MethodGenerator::class); $methodGenerator diff --git a/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php b/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php index 9205d1624..d3b0de442 100644 --- a/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php +++ b/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php @@ -5,17 +5,20 @@ namespace ProxyManagerTest\GeneratorStrategy; use Closure; +use ErrorException; use PHPUnit\Framework\TestCase; use ProxyManager\Exception\FileNotWritableException; use ProxyManager\FileLocator\FileLocatorInterface; use ProxyManager\Generator\ClassGenerator; use ProxyManager\Generator\Util\UniqueIdentifierGenerator; use ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy; +use const SCANDIR_SORT_ASCENDING; use function class_exists; use function clearstatcache; use function decoct; use function fileperms; use function mkdir; +use function restore_error_handler; use function rmdir; use function scandir; use function set_error_handler; @@ -24,7 +27,7 @@ use function tempnam; use function umask; use function uniqid; -use const SCANDIR_SORT_ASCENDING; +use function unlink; /** * Tests for {@see \ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy} @@ -43,9 +46,9 @@ protected function setUp() : void { parent::setUp(); - $this->tempDir = tempnam(sys_get_temp_dir(), 'FileWriterGeneratorStrategyTest'); - $this->originalErrorHandler = static function () { - throw new \ErrorException(); + $this->tempDir = tempnam(sys_get_temp_dir(), 'FileWriterGeneratorStrategyTest'); + $this->originalErrorHandler = static function () : bool { + throw new ErrorException(); }; unlink($this->tempDir); @@ -55,7 +58,8 @@ protected function setUp() : void protected function tearDown() : void { - self::assertSame($this->originalErrorHandler, set_error_handler(static function () { + self::assertSame($this->originalErrorHandler, set_error_handler(static function () : bool { + return true; })); restore_error_handler(); restore_error_handler(); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AbstractProxyGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AbstractProxyGeneratorTest.php index 6a116f3a7..024c81276 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AbstractProxyGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AbstractProxyGeneratorTest.php @@ -36,7 +36,6 @@ abstract class AbstractProxyGeneratorTest extends TestCase * @dataProvider getTestedImplementations * * Verifies that generated code is valid and implements expected interfaces - * * @psalm-param class-string $className */ public function testGeneratesValidCode(string $className) : void diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicCloneTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicCloneTest.php index e68732957..b67c78e56 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicCloneTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicCloneTest.php @@ -24,7 +24,7 @@ final class MagicCloneTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -43,7 +43,7 @@ public function testBodyStructure() : void */ public function testBodyStructureWithInheritedMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicGetTest.php index 5fd913783..71ce18cbe 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicGetTest.php @@ -24,7 +24,7 @@ final class MagicGetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -47,7 +47,7 @@ public function testBodyStructure() : void */ public function testBodyStructureWithInheritedMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicIssetTest.php index 3ac459458..1d6cef46b 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicIssetTest.php @@ -24,7 +24,7 @@ final class MagicIssetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -47,7 +47,7 @@ public function testBodyStructure() : void */ public function testBodyStructureWithInheritedMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSetTest.php index e8b7a4662..d346141f2 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSetTest.php @@ -24,7 +24,7 @@ final class MagicSetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -47,7 +47,7 @@ public function testBodyStructure() : void */ public function testBodyStructureWithInheritedMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSleepTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSleepTest.php index 47b032ef8..ba5654e9f 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSleepTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSleepTest.php @@ -24,7 +24,7 @@ final class MagicSleepTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -47,7 +47,7 @@ public function testBodyStructure() : void */ public function testBodyStructureWithInheritedMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicUnsetTest.php index cd698cfa0..2ce8c83c3 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicUnsetTest.php @@ -24,7 +24,7 @@ final class MagicUnsetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -47,7 +47,7 @@ public function testBodyStructure() : void */ public function testBodyStructureWithInheritedMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGeneratorTest.php index 7c21fe842..ab145f34c 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGeneratorTest.php @@ -24,9 +24,9 @@ final class InterceptorGeneratorTest extends TestCase { public function testInterceptorGenerator() : void { - $method = $this->createMock(MethodGenerator::class); - $bar = $this->createMock(ParameterGenerator::class); - $baz = $this->createMock(ParameterGenerator::class); + $method = $this->createMock(MethodGenerator::class); + $bar = $this->createMock(ParameterGenerator::class); + $baz = $this->createMock(ParameterGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -77,9 +77,9 @@ public function testInterceptorGenerator() : void public function testInterceptorGeneratorWithVoidReturnType() : void { - $method = $this->createMock(MethodGenerator::class); - $bar = $this->createMock(ParameterGenerator::class); - $baz = $this->createMock(ParameterGenerator::class); + $method = $this->createMock(MethodGenerator::class); + $bar = $this->createMock(ParameterGenerator::class); + $baz = $this->createMock(ParameterGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -133,9 +133,9 @@ public function testInterceptorGeneratorWithVoidReturnType() : void public function testInterceptorGeneratorWithExistingNonVoidMethod() : void { - $method = $this->createMock(MethodGenerator::class); - $bar = $this->createMock(ParameterGenerator::class); - $baz = $this->createMock(ParameterGenerator::class); + $method = $this->createMock(MethodGenerator::class); + $bar = $this->createMock(ParameterGenerator::class); + $baz = $this->createMock(ParameterGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/InterceptedMethodTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/InterceptedMethodTest.php index 37257d11e..15865385d 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/InterceptedMethodTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/InterceptedMethodTest.php @@ -23,7 +23,7 @@ final class InterceptedMethodTest extends TestCase { public function testBodyStructure() : void { - $valueHolder = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicCloneTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicCloneTest.php index 6702ddfd3..454be54ac 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicCloneTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicCloneTest.php @@ -23,8 +23,8 @@ final class MagicCloneTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicGetTest.php index 4589fbfd3..262aae4ec 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicGetTest.php @@ -24,11 +24,11 @@ final class MagicGetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); - $publicProperties = $this->createMock(PublicPropertiesMap::class); + $publicProperties = $this->createMock(PublicPropertiesMap::class); $valueHolder->method('getName')->willReturn('bar'); $prefixInterceptors->method('getName')->willReturn('pre'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicIssetTest.php index c6d7074b4..5285a7abb 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicIssetTest.php @@ -25,11 +25,11 @@ final class MagicIssetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); - $publicProperties = $this->createMock(PublicPropertiesMap::class); + $publicProperties = $this->createMock(PublicPropertiesMap::class); $valueHolder->method('getName')->willReturn('bar'); $prefixInterceptors->method('getName')->willReturn('pre'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicSetTest.php index 45a7cdbbc..74813686f 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicSetTest.php @@ -25,11 +25,11 @@ final class MagicSetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); - $publicProperties = $this->createMock(PublicPropertiesMap::class); + $publicProperties = $this->createMock(PublicPropertiesMap::class); $valueHolder->method('getName')->willReturn('bar'); $prefixInterceptors->method('getName')->willReturn('pre'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicUnsetTest.php index e0e53921b..f4708d5d5 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicUnsetTest.php @@ -25,11 +25,11 @@ final class MagicUnsetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); - $publicProperties = $this->createMock(PublicPropertiesMap::class); + $publicProperties = $this->createMock(PublicPropertiesMap::class); $valueHolder->method('getName')->willReturn('bar'); $prefixInterceptors->method('getName')->willReturn('pre'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/StaticProxyConstructorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/StaticProxyConstructorTest.php index 45e8c4c14..7eceb95fa 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/StaticProxyConstructorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/StaticProxyConstructorTest.php @@ -23,7 +23,7 @@ final class StaticProxyConstructorTest extends TestCase { public function testBodyStructure() : void { - $valueHolder = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -63,7 +63,7 @@ public function testBodyStructure() : void public function testBodyStructureWithoutPublicProperties() : void { - $valueHolder = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -98,7 +98,7 @@ public function testBodyStructureWithoutPublicProperties() : void */ public function testUnsetsPrivatePropertiesAsWell() : void { - $valueHolder = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/Util/InterceptorGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/Util/InterceptorGeneratorTest.php index 2ddedb9a4..4623b38a6 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/Util/InterceptorGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/Util/InterceptorGeneratorTest.php @@ -24,10 +24,10 @@ final class InterceptorGeneratorTest extends TestCase { public function testInterceptorGenerator() : void { - $method = $this->createMock(MethodGenerator::class); - $bar = $this->createMock(ParameterGenerator::class); - $baz = $this->createMock(ParameterGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $method = $this->createMock(MethodGenerator::class); + $bar = $this->createMock(ParameterGenerator::class); + $baz = $this->createMock(ParameterGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -80,10 +80,10 @@ public function testInterceptorGenerator() : void public function testInterceptorGeneratorWithVoidMethod() : void { - $method = $this->createMock(MethodGenerator::class); - $bar = $this->createMock(ParameterGenerator::class); - $baz = $this->createMock(ParameterGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $method = $this->createMock(MethodGenerator::class); + $bar = $this->createMock(ParameterGenerator::class); + $baz = $this->createMock(ParameterGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); @@ -139,10 +139,10 @@ public function testInterceptorGeneratorWithVoidMethod() : void public function testInterceptorGeneratorWithNonVoidOriginalMethod() : void { - $method = $this->createMock(MethodGenerator::class); - $bar = $this->createMock(ParameterGenerator::class); - $baz = $this->createMock(ParameterGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $method = $this->createMock(MethodGenerator::class); + $bar = $this->createMock(ParameterGenerator::class); + $baz = $this->createMock(ParameterGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $prefixInterceptors = $this->createMock(PropertyGenerator::class); $suffixInterceptors = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/Assertion/CanProxyAssertionTest.php b/tests/ProxyManagerTest/ProxyGenerator/Assertion/CanProxyAssertionTest.php index a68ea6812..5eb69fc72 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/Assertion/CanProxyAssertionTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/Assertion/CanProxyAssertionTest.php @@ -75,7 +75,6 @@ public function testDeniesInterfaceIfSpecified() : void /** * @dataProvider validClasses - * * @psalm-param class-string $className */ public function testAllowedClass(string $className) : void diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializerTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializerTest.php index 9320ba97d..8f44034e7 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializerTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializerTest.php @@ -23,7 +23,7 @@ final class CallInitializerTest extends TestCase { public function testBodyStructure() : void { - $initializer = $this->createMock(PropertyGenerator::class); + $initializer = $this->createMock(PropertyGenerator::class); $initializationTracker = $this->createMock(PropertyGenerator::class); $initializer->method('getName')->willReturn('init'); @@ -94,7 +94,7 @@ public function testBodyStructure() : void public function testBodyStructureWithTypedProperties() : void { - $initializer = $this->createMock(PropertyGenerator::class); + $initializer = $this->createMock(PropertyGenerator::class); $initializationTracker = $this->createMock(PropertyGenerator::class); $initializer->method('getName')->willReturn('init'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/InitializeProxyTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/InitializeProxyTest.php index afef0c788..62e2558a6 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/InitializeProxyTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/InitializeProxyTest.php @@ -23,7 +23,7 @@ final class InitializeProxyTest extends TestCase public function testBodyStructure() : void { $initializer = $this->createMock(PropertyGenerator::class); - $initCall = $this->createMock(MethodGenerator::class); + $initCall = $this->createMock(MethodGenerator::class); $initializer->method('getName')->willReturn('foo'); $initCall->method('getName')->willReturn('bar'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicCloneTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicCloneTest.php index 59f1842e4..de7846fa9 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicCloneTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicCloneTest.php @@ -24,9 +24,9 @@ final class MagicCloneTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $initializer = $this->createMock(PropertyGenerator::class); - $initCall = $this->createMock(MethodGenerator::class); + $initCall = $this->createMock(MethodGenerator::class); $initializer->method('getName')->willReturn('foo'); $initCall->method('getName')->willReturn('bar'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSleepTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSleepTest.php index 3fd9e346e..efc3ab6c3 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSleepTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSleepTest.php @@ -24,9 +24,9 @@ final class MagicSleepTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $initializer = $this->createMock(PropertyGenerator::class); - $initMethod = $this->createMock(MethodGenerator::class); + $initMethod = $this->createMock(MethodGenerator::class); $initializer->method('getName')->willReturn('foo'); $initMethod->method('getName')->willReturn('bar'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/LazyLoadingMethodInterceptorTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/LazyLoadingMethodInterceptorTest.php index a3c90a027..e90f67d1e 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/LazyLoadingMethodInterceptorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/LazyLoadingMethodInterceptorTest.php @@ -48,8 +48,8 @@ public function testBodyStructure() : void public function testBodyStructureWithoutParameters() : void { $reflectionMethod = new MethodReflection(BaseClass::class, 'publicMethod'); - $initializer = $this->createMock(PropertyGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $initializer = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $initializer->method('getName')->willReturn('foo'); $valueHolder->method('getName')->willReturn('bar'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicCloneTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicCloneTest.php index b7eec9e45..54b6eb429 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicCloneTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicCloneTest.php @@ -23,7 +23,7 @@ final class MagicCloneTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $initializer = $this->createMock(PropertyGenerator::class); $valueHolder = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicGetTest.php index d40ba4e9b..8954091f8 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicGetTest.php @@ -25,9 +25,9 @@ final class MagicGetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $initializer = $this->createMock(PropertyGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $initializer = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $publicProperties = $this->createMock(PublicPropertiesMap::class); $initializer->method('getName')->willReturn('foo'); @@ -54,9 +54,9 @@ public function testBodyStructure() : void */ public function testBodyStructureWithPreExistingGetMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); - $initializer = $this->createMock(PropertyGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $initializer = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $publicProperties = $this->createMock(PublicPropertiesMap::class); $initializer->method('getName')->willReturn('foo'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicIssetTest.php index ff05bf623..f49d2ffa1 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicIssetTest.php @@ -24,9 +24,9 @@ final class MagicIssetTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $initializer = $this->createMock(PropertyGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $initializer = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $publicProperties = $this->createMock(PublicPropertiesMap::class); $initializer->method('getName')->willReturn('foo'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSetTest.php index be8a0b1ea..5f202eb68 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSetTest.php @@ -23,9 +23,9 @@ final class MagicSetTest extends TestCase { public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $initializer = $this->createMock(PropertyGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $initializer = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $publicProperties = $this->createMock(PublicPropertiesMap::class); $initializer->method('getName')->willReturn('foo'); @@ -51,9 +51,9 @@ public function testBodyStructure() : void */ public function testBodyStructureWithPreExistingMagicMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); - $initializer = $this->createMock(PropertyGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $initializer = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $publicProperties = $this->createMock(PublicPropertiesMap::class); $initializer->method('getName')->willReturn('foo'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSleepTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSleepTest.php index 3b5f17107..ad07878c9 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSleepTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSleepTest.php @@ -23,7 +23,7 @@ final class MagicSleepTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $initializer = $this->createMock(PropertyGenerator::class); $valueHolder = $this->createMock(PropertyGenerator::class); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicUnsetTest.php index b403308f9..fb720b986 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicUnsetTest.php @@ -23,9 +23,9 @@ final class MagicUnsetTest extends TestCase { public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); - $initializer = $this->createMock(PropertyGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(EmptyClass::class); + $initializer = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $publicProperties = $this->createMock(PublicPropertiesMap::class); $initializer->method('getName')->willReturn('foo'); @@ -51,9 +51,9 @@ public function testBodyStructure() : void */ public function testBodyStructureWithPreExistingMagicMethod() : void { - $reflection = new ReflectionClass(ClassWithMagicMethods::class); - $initializer = $this->createMock(PropertyGenerator::class); - $valueHolder = $this->createMock(PropertyGenerator::class); + $reflection = new ReflectionClass(ClassWithMagicMethods::class); + $initializer = $this->createMock(PropertyGenerator::class); + $valueHolder = $this->createMock(PropertyGenerator::class); $publicProperties = $this->createMock(PublicPropertiesMap::class); $initializer->method('getName')->willReturn('foo'); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicGetTest.php index ca61c5256..e3710a565 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicGetTest.php @@ -24,7 +24,7 @@ final class MagicGetTest extends TestCase public function testBodyStructure() : void { $reflection = new ReflectionClass(EmptyClass::class); - $adapter = $this->createMock(PropertyGenerator::class); + $adapter = $this->createMock(PropertyGenerator::class); $adapter->method('getName')->willReturn('foo'); $magicGet = new MagicGet($reflection, $adapter); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicIssetTest.php index 8a5096bce..39358a58c 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicIssetTest.php @@ -24,7 +24,7 @@ final class MagicIssetTest extends TestCase public function testBodyStructure() : void { $reflection = new ReflectionClass(EmptyClass::class); - $adapter = $this->createMock(PropertyGenerator::class); + $adapter = $this->createMock(PropertyGenerator::class); $adapter->method('getName')->willReturn('foo'); $magicGet = new MagicIsset($reflection, $adapter); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicSetTest.php index 13ccc6ed0..b109f3b2c 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicSetTest.php @@ -24,7 +24,7 @@ final class MagicSetTest extends TestCase public function testBodyStructure() : void { $reflection = new ReflectionClass(EmptyClass::class); - $adapter = $this->createMock(PropertyGenerator::class); + $adapter = $this->createMock(PropertyGenerator::class); $adapter->method('getName')->willReturn('foo'); $magicGet = new MagicSet($reflection, $adapter); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicUnsetTest.php index c999d4843..e296d611b 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicUnsetTest.php @@ -24,7 +24,7 @@ final class MagicUnsetTest extends TestCase public function testBodyStructure() : void { $reflection = new ReflectionClass(EmptyClass::class); - $adapter = $this->createMock(PropertyGenerator::class); + $adapter = $this->createMock(PropertyGenerator::class); $adapter->method('getName')->willReturn('foo'); $magicGet = new MagicUnset($reflection, $adapter); diff --git a/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php b/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php index dd7a1a14e..a56550c9b 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php @@ -15,6 +15,7 @@ use ProxyManagerTestAsset\ClassWithPrivateProperties; use ReflectionClass; use ReflectionProperty; +use function array_keys; use function array_map; use function array_values; @@ -422,7 +423,7 @@ public function propertiesToSkipFixture() : array ]; } - public function testWithoutNonReferenceableProperties() + public function testWithoutNonReferenceableProperties() : void { $properties = Properties::fromReflectionClass(new ReflectionClass(ClassWithMixedTypedProperties::class)) ->withoutNonReferenceableProperties() diff --git a/tests/ProxyManagerTest/ProxyGenerator/Util/UnsetPropertiesGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/Util/UnsetPropertiesGeneratorTest.php index 37511bc45..9c74ae8e8 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/Util/UnsetPropertiesGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/Util/UnsetPropertiesGeneratorTest.php @@ -24,7 +24,6 @@ final class UnsetPropertiesGeneratorTest extends TestCase { /** * @dataProvider classNamesProvider - * * @psalm-param class-string $className */ public function testGeneratedCode(string $className, string $expectedCode, string $instanceName) : void diff --git a/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/MagicSleepTest.php b/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/MagicSleepTest.php index 168e86375..eb862712d 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/MagicSleepTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/MagicSleepTest.php @@ -23,7 +23,7 @@ final class MagicSleepTest extends TestCase */ public function testBodyStructure() : void { - $reflection = new ReflectionClass(EmptyClass::class); + $reflection = new ReflectionClass(EmptyClass::class); $valueHolder = $this->createMock(PropertyGenerator::class); $valueHolder->method('getName')->willReturn('bar');