diff --git a/composer.lock b/composer.lock index f275a79de7cc50d0dabd240f1f752af108eff4f2..cfe7b576136670f5dd8294dd2bbb1af384c464fd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8d1cf2aaac4a3a61f6326b16563930f9", + "content-hash": "b17cd1908056de096028555fb0e0c1f1", "packages": [ { "name": "nette/finder", @@ -75,16 +75,16 @@ }, { "name": "nette/php-generator", - "version": "v3.5.1", + "version": "v3.5.2", "source": { "type": "git", "url": "https://github.com/nette/php-generator.git", - "reference": "fe54415cd22d01bee1307a608058bf131978610a" + "reference": "41dcc5d1cb322835e5950a76515166c90923c6b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/fe54415cd22d01bee1307a608058bf131978610a", - "reference": "fe54415cd22d01bee1307a608058bf131978610a", + "url": "https://api.github.com/repos/nette/php-generator/zipball/41dcc5d1cb322835e5950a76515166c90923c6b7", + "reference": "41dcc5d1cb322835e5950a76515166c90923c6b7", "shasum": "" }, "require": { @@ -137,9 +137,9 @@ ], "support": { "issues": "https://github.com/nette/php-generator/issues", - "source": "https://github.com/nette/php-generator/tree/v3.5.1" + "source": "https://github.com/nette/php-generator/tree/v3.5.2" }, - "time": "2020-11-04T11:26:26+00:00" + "time": "2021-01-19T13:02:23+00:00" }, { "name": "nette/utils", @@ -1690,7 +1690,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.0" + "php": "^8.0", + "ext-tokenizer": "*" }, "platform-dev": [], "plugin-api-version": "2.0.0" diff --git a/tests/KeepMethodDecorator/Stub/StubKeepMethod.php b/tests/KeepMethodDecorator/Stub/StubKeepMethod.php index 026dde9a6c57453e9828eb62aa44c9d49f5fb93f..aab94dcd09141cb954b8fb2ac5c8066587b5839a 100644 --- a/tests/KeepMethodDecorator/Stub/StubKeepMethod.php +++ b/tests/KeepMethodDecorator/Stub/StubKeepMethod.php @@ -16,6 +16,8 @@ final class StubKeepMethod public function methodToBeKeptWithParam(int $whatever): void {} + public function methodToBeKeptWithMixedParam(mixed $whatever): void {} + public function methodToBeKeptWithImportedUses(ClassDefinitionBuilder $builder): string { return ClassDefinition::class; } diff --git a/tests/KeepMethodDecorator/Stub/StubKeepMethod.preserved.phps b/tests/KeepMethodDecorator/Stub/StubKeepMethod.preserved.phps index 942de5f0faae2467528dac9d9f44a856c851ec1d..891f77ffeb1284a6fab16c4e443498ff74c68cdc 100644 --- a/tests/KeepMethodDecorator/Stub/StubKeepMethod.preserved.phps +++ b/tests/KeepMethodDecorator/Stub/StubKeepMethod.preserved.phps @@ -14,7 +14,7 @@ final class StubKeepMethod } - public function methodToBeKept(): ?mixed + public function methodToBeKept(): mixed { return 'whatever'; } @@ -25,6 +25,11 @@ final class StubKeepMethod } + public function methodToBeKeptWithMixedParam(mixed $whatever): void + { + } + + public function methodToBeKeptWithImportedUses(ClassDefinitionBuilder $builder): string { return ClassDefinition::class; diff --git a/tests/KeepMethodDecorator/keepMethodDecorator.phpt b/tests/KeepMethodDecorator/keepMethodDecorator.phpt index f3a1b19b9dc58bf82351fc3c995c79526f035f42..edf04aeb50791067104141991a1946f09a9cad68 100644 --- a/tests/KeepMethodDecorator/keepMethodDecorator.phpt +++ b/tests/KeepMethodDecorator/keepMethodDecorator.phpt @@ -30,6 +30,7 @@ Assert::matchFile( new \Grifart\ClassScaffolder\Decorators\KeepMethodDecorator('newMethod'), new \Grifart\ClassScaffolder\Decorators\KeepMethodDecorator('methodToBeKept'), new \Grifart\ClassScaffolder\Decorators\KeepMethodDecorator('methodToBeKeptWithParam'), + new \Grifart\ClassScaffolder\Decorators\KeepMethodDecorator('methodToBeKeptWithMixedParam'), new \Grifart\ClassScaffolder\Decorators\KeepMethodDecorator('methodToBeKeptWithImportedUses'), new \Grifart\ClassScaffolder\Decorators\KeepMethodDecorator('methodToBeKeptWithAnnotation'), ]),