Skip to content
Snippets Groups Projects
Commit 8f1c68ea authored by Daniel Kurowski's avatar Daniel Kurowski
Browse files

Merge branch '17-fix-keep-method-with-mixed-param' into 'master'

Added method to test

Closes #17

See merge request grifart/class-scaffolder!28
parents 7e7a159b 44ca4a44
No related branches found
No related tags found
1 merge request!28Fixed keep method decorator with mixed param
Pipeline #31520 passed
......@@ -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"
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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'),
]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment