From 84a913a9f8266d59d5d7e0f8299b36bf937706ad Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Wed, 14 Dec 2022 17:23:29 +0100 Subject: [PATCH] feat(Testing): Pass method parameters to expectation hook. BREAKING CHANGE: hook closure now receives more properties (expectation is last). --- composer.json | 2 +- .../Commands/MakeExpectationCommand.php | 31 ++++++++++++++++--- .../MultiFunctionContractAssert.php.stub | 22 ++++++------- ...iFunctionContractMixedExpectation.php.stub | 2 +- ...nctionContractNoReturnExpectation.php.stub | 2 +- ...tionContractPhpDocBoolExpectation.php.stub | 2 +- ...ionContractPhpDocFloatExpectation.php.stub | 2 +- ...ionContractPhpDocMixedExpectation.php.stub | 2 +- ...onContractPhpDocStaticExpectation.php.stub | 2 +- ...onContractPhpDocStringExpectation.php.stub | 2 +- ...tionContractPhpDocThisExpectation.php.stub | 2 +- ...ntractPhpDocThisParamsExpectation.php.stub | 2 +- ...tiFunctionContractSelfExpectation.php.stub | 2 +- ...onContractSelfViaClassExpectation.php.stub | 2 +- .../SimpleActionContractAssert.php | 2 +- .../SimpleActionContractExpectation.php | 2 +- .../TestActionContractAssert.php.stub | 2 +- .../TestActionContractExpectation.php.stub | 2 +- .../TestActionExpectation.php.stub | 2 +- .../TestReturnActionContractAssert.php.stub | 2 +- ...stReturnActionContractExpectation.php.stub | 2 +- .../TestReturnActionExpectation.php.stub | 2 +- ...turnIntersectionActionExpectation.php.stub | 2 +- ...stReturnRequiredActionExpectation.php.stub | 2 +- .../TestReturnUnionActionExpectation.php.stub | 2 +- .../one.MultiFunctionContractAssert.php.stub | 22 ++++++------- ...iFunctionContractMixedExpectation.php.stub | 2 +- ...nctionContractNoReturnExpectation.php.stub | 2 +- ...tionContractPhpDocBoolExpectation.php.stub | 2 +- ...ionContractPhpDocFloatExpectation.php.stub | 2 +- ...ionContractPhpDocMixedExpectation.php.stub | 2 +- ...onContractPhpDocStaticExpectation.php.stub | 2 +- ...onContractPhpDocStringExpectation.php.stub | 2 +- ...tionContractPhpDocThisExpectation.php.stub | 2 +- ...ntractPhpDocThisParamsExpectation.php.stub | 2 +- ...tiFunctionContractSelfExpectation.php.stub | 2 +- ...onContractSelfViaClassExpectation.php.stub | 2 +- .../one.TestActionContractAssert.php.stub | 2 +- ...one.TestActionContractExpectation.php.stub | 2 +- .../one.TestActionExpectation.php.stub | 2 +- ...ne.TestReturnActionContractAssert.php.stub | 2 +- ...stReturnActionContractExpectation.php.stub | 2 +- .../one.TestReturnActionExpectation.php.stub | 2 +- ...turnIntersectionActionExpectation.php.stub | 2 +- ...stReturnRequiredActionExpectation.php.stub | 2 +- ....TestReturnUnionActionExpectation.php.stub | 2 +- .../two.MultiFunctionContractAssert.php.stub | 22 ++++++------- ...iFunctionContractMixedExpectation.php.stub | 2 +- ...nctionContractNoReturnExpectation.php.stub | 2 +- ...tionContractPhpDocBoolExpectation.php.stub | 2 +- ...ionContractPhpDocFloatExpectation.php.stub | 2 +- ...ionContractPhpDocMixedExpectation.php.stub | 2 +- ...onContractPhpDocStaticExpectation.php.stub | 2 +- ...onContractPhpDocStringExpectation.php.stub | 2 +- ...tionContractPhpDocThisExpectation.php.stub | 2 +- ...ntractPhpDocThisParamsExpectation.php.stub | 2 +- ...tiFunctionContractSelfExpectation.php.stub | 2 +- ...onContractSelfViaClassExpectation.php.stub | 2 +- .../two.TestActionContractAssert.php.stub | 2 +- ...two.TestActionContractExpectation.php.stub | 2 +- .../two.TestActionExpectation.php.stub | 2 +- ...wo.TestReturnActionContractAssert.php.stub | 2 +- ...stReturnActionContractExpectation.php.stub | 2 +- .../two.TestReturnActionExpectation.php.stub | 2 +- ...turnIntersectionActionExpectation.php.stub | 2 +- ...stReturnRequiredActionExpectation.php.stub | 2 +- ....TestReturnUnionActionExpectation.php.stub | 2 +- .../MakeExpectationCommandRealTest.php | 5 ++- 68 files changed, 127 insertions(+), 101 deletions(-) diff --git a/composer.json b/composer.json index e2f141e6..f261afd9 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "post-autoload-dump": [ "@php ./vendor/bin/testbench package:discover --ansi" ], - "check": "composer lint && composer test", + "check": "composer lint && composer test && composer lint:stan", "lint:check": "./vendor/bin/ecs", "lint:fix": "./vendor/bin/ecs --fix", "lint:stan": "./vendor/bin/phpstan", diff --git a/src/Testing/Commands/MakeExpectationCommand.php b/src/Testing/Commands/MakeExpectationCommand.php index 0c5d05c2..06ff6ed0 100644 --- a/src/Testing/Commands/MakeExpectationCommand.php +++ b/src/Testing/Commands/MakeExpectationCommand.php @@ -209,11 +209,14 @@ protected function generateExpectationMethodAssert( : $expectationClassName . '::class' )); + $hookParameters = []; + if ($parameters !== []) { $assertMethod->addBody('$message = $this->getDebugMessage();'); $assertMethod->addBody(''); foreach ($parameters as $parameter) { + $hookParameters[] = sprintf('$%s', $parameter->name); $assertMethod->addBody(sprintf( 'Assert::assertEquals($expectation->%s, $%s, $message);', $parameter->name, @@ -225,7 +228,11 @@ protected function generateExpectationMethodAssert( $assertMethod->addBody(''); $assertMethod->addBody(sprintf('if (is_callable($expectation->%s)) {', self::HookProperty)); - $assertMethod->addBody(sprintf(' call_user_func($expectation->%s, $expectation);', self::HookProperty)); + $assertMethod->addBody(sprintf( + ' call_user_func($expectation->%s, %s, $expectation);', + self::HookProperty, + implode(', ', $hookParameters), + )); $assertMethod->addBody('}'); $returnType = $method->getReturnType(); @@ -321,12 +328,13 @@ protected function getExpectationFileContents( $this->setParameterType($returnType, $constructorParameter); } + $parameterTypes = []; foreach ($parameters as $parameter) { $constructorParameter = $constructor ->addPromotedParameter($parameter->name) ->setReadOnly(); - $this->setParameterType($parameter->getType(), $constructorParameter); + $parameterTypes[] = $this->setParameterType($parameter->getType(), $constructorParameter); $this->setParameterDefaultValue($parameter, $constructorParameter); } @@ -337,7 +345,9 @@ protected function getExpectationFileContents( ->setNullable() ->setDefaultValue(null); - $constructor->addComment(sprintf('@param \Closure(self):void|null $%s', self::HookProperty)); + $constructor->addComment( + sprintf('@param \Closure(%s,self):void|null $%s', implode(',', $parameterTypes), self::HookProperty) + ); return $printer->printFile($file); } @@ -345,7 +355,7 @@ protected function getExpectationFileContents( protected function setParameterType( ReflectionType|ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType|null $type, PromotedParameter $constructorParameter - ): void { + ): string { $proposedType = ''; $allowNull = false; @@ -356,6 +366,11 @@ protected function setParameterType( $allowNull = false; } + // Fix global namespace + if (class_exists($name)) { + return '\\' . $name; + } + return $name; } @@ -366,6 +381,12 @@ protected function setParameterType( if ($type instanceof ReflectionNamedType) { $allowNull = $type->allowsNull(); $proposedType = $type->getName(); + + if (class_exists($proposedType)) { + // Fix global namespace + $proposedType = '\\' . $proposedType; + } + $constructorParameter->setNullable($type->allowsNull()); } elseif ($type instanceof ReflectionUnionType) { $allowNull = $type->allowsNull(); @@ -389,6 +410,8 @@ protected function setParameterType( } $constructorParameter->setType($proposedType); + + return $proposedType; } protected function setParameterDefaultValue( diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractAssert.php.stub index 1333d8c4..b794358d 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractAssert.php.stub @@ -57,7 +57,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -76,7 +76,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -99,7 +99,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -118,7 +118,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -137,7 +137,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -156,7 +156,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -175,7 +175,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -194,7 +194,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -213,7 +213,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -229,7 +229,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } } @@ -243,7 +243,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractMixedExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractMixedExpectation.php.stub index 01a935d3..4e597470 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractMixedExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractMixedExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractMixedExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractNoReturnExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractNoReturnExpectation.php.stub index cf6b69a9..82ace040 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractNoReturnExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractNoReturnExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractNoReturnExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocBoolExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocBoolExpectation.php.stub index 4c4ac659..9269b563 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocBoolExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocBoolExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocBoolExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,\Closure,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocFloatExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocFloatExpectation.php.stub index e3ba3874..d50f6fa8 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocFloatExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocFloatExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocFloatExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocMixedExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocMixedExpectation.php.stub index e1983d71..143fd27f 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocMixedExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocMixedExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocMixedExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocStaticExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocStaticExpectation.php.stub index 42ecddb3..d456713f 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocStaticExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocStaticExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocStaticExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocStringExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocStringExpectation.php.stub index 91d91a3c..3dd86f06 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocStringExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocStringExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocStringExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocThisExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocThisExpectation.php.stub index cf041fe9..1a0b12d9 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocThisExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocThisExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocThisExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(string,int,bool,self):void|null $hook */ public function __construct( public readonly string $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocThisParamsExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocThisParamsExpectation.php.stub index 259abd89..ee0da74a 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocThisParamsExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractPhpDocThisParamsExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocThisParamsExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractSelfExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractSelfExpectation.php.stub index 6d6a629f..d95be8e8 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractSelfExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractSelfExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractSelfExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(string,int,bool,self):void|null $hook */ public function __construct( public readonly string $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractSelfViaClassExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractSelfViaClassExpectation.php.stub index d3ca6bb8..85131fbd 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractSelfViaClassExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractSelfViaClassExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractSelfViaClassExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractAssert.php b/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractAssert.php index 1b71fdde..b741046a 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractAssert.php +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractAssert.php @@ -21,7 +21,7 @@ function execute(string $first, int $second, bool $third) Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractExpectation.php b/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractExpectation.php index 81269429..2fb91180 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractExpectation.php +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractExpectation.php @@ -7,7 +7,7 @@ final class SimpleActionContractExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(string,int,bool,self):void|null $hook */ public function __construct( public readonly string $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractAssert.php.stub index 257ba1c3..2a04fd17 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractAssert.php.stub @@ -52,7 +52,7 @@ class TestActionContractAssert extends \LaraStrict\Testing\AbstractExpectationCa Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); } } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractExpectation.php.stub index c08819e7..13f6a984 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestActionContractExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $int, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionExpectation.php.stub index 5e59f904..20334865 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $int, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractAssert.php.stub index 291bc86e..d0304cc5 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractAssert.php.stub @@ -52,7 +52,7 @@ class TestReturnActionContractAssert extends \LaraStrict\Testing\AbstractExpecta Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); } return $expectation->return; diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractExpectation.php.stub index 0d06958b..b1799c8a 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnActionContractExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly ?int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionExpectation.php.stub index 4047f8f4..9746a792 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly ?int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnIntersectionActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnIntersectionActionExpectation.php.stub index f9f095c7..d853a05e 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnIntersectionActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnIntersectionActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnIntersectionActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly \ArrayAccess&\Illuminate\Support\Enumerable $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnRequiredActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnRequiredActionExpectation.php.stub index 3e769660..50d2d321 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnRequiredActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnRequiredActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnRequiredActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnUnionActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnUnionActionExpectation.php.stub index 86fcccbe..a1385577 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnUnionActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnUnionActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnUnionActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly \LaraStrict\Testing\Laravel\TestingApplication|string|int|null $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractAssert.php.stub index ca935249..3233f40f 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractAssert.php.stub @@ -57,7 +57,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -76,7 +76,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -99,7 +99,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -118,7 +118,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -137,7 +137,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -156,7 +156,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -175,7 +175,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -194,7 +194,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -213,7 +213,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -229,7 +229,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } } @@ -243,7 +243,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractMixedExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractMixedExpectation.php.stub index 19732945..69d121eb 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractMixedExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractMixedExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractMixedExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractNoReturnExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractNoReturnExpectation.php.stub index aff62310..ab75224b 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractNoReturnExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractNoReturnExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractNoReturnExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocBoolExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocBoolExpectation.php.stub index 02233f9c..f997c5e4 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocBoolExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocBoolExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocBoolExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,\Closure,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocFloatExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocFloatExpectation.php.stub index e9e40c0e..ae93fbf1 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocFloatExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocFloatExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocFloatExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocMixedExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocMixedExpectation.php.stub index 60998533..67a6016b 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocMixedExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocMixedExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocMixedExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocStaticExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocStaticExpectation.php.stub index 218dbd94..a5d8be58 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocStaticExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocStaticExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocStaticExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocStringExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocStringExpectation.php.stub index 7322ee0f..52edbd6a 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocStringExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocStringExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocStringExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocThisExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocThisExpectation.php.stub index 6c2d3a3a..c9054f41 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocThisExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocThisExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocThisExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(string,int,bool,self):void|null $hook */ public function __construct( public readonly string $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocThisParamsExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocThisParamsExpectation.php.stub index 0e0dfe7a..67c9f7f9 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocThisParamsExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractPhpDocThisParamsExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractPhpDocThisParamsExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractSelfExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractSelfExpectation.php.stub index 19c37773..52b6b3da 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractSelfExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractSelfExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractSelfExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(string,int,bool,self):void|null $hook */ public function __construct( public readonly string $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractSelfViaClassExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractSelfViaClassExpectation.php.stub index d7915290..44c0da06 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractSelfViaClassExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractSelfViaClassExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class MultiFunctionContractSelfViaClassExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractAssert.php.stub index 59e84167..9a59ba65 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractAssert.php.stub @@ -52,7 +52,7 @@ class TestActionContractAssert extends \LaraStrict\Testing\AbstractExpectationCa Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); } } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractExpectation.php.stub index aa5b7c79..8753c943 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestActionContractExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $int, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionExpectation.php.stub index 36e13198..6207c34a 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $int, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractAssert.php.stub index 6b77071d..f50b0398 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractAssert.php.stub @@ -52,7 +52,7 @@ class TestReturnActionContractAssert extends \LaraStrict\Testing\AbstractExpecta Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); } return $expectation->return; diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractExpectation.php.stub index e51700ba..e56fa9c1 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnActionContractExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly ?int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionExpectation.php.stub index 1e97a68a..b34d05e4 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly ?int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnIntersectionActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnIntersectionActionExpectation.php.stub index d36626ec..7b98430b 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnIntersectionActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnIntersectionActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnIntersectionActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly \ArrayAccess&\Illuminate\Support\Enumerable $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnRequiredActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnRequiredActionExpectation.php.stub index c89d4388..d2e55c6a 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnRequiredActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnRequiredActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnRequiredActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnUnionActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnUnionActionExpectation.php.stub index 3678f418..ad9bc8dc 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnUnionActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnUnionActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Tests\LaraStrict\Feature\Testing\Commands\MakeExpectationCommand; final class TestReturnUnionActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly \LaraStrict\Testing\Laravel\TestingApplication|string|int|null $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractAssert.php.stub index b0f52e7e..ae6599c6 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractAssert.php.stub @@ -57,7 +57,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -76,7 +76,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -99,7 +99,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -118,7 +118,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -137,7 +137,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -156,7 +156,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -175,7 +175,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -194,7 +194,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $this; @@ -213,7 +213,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; @@ -229,7 +229,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } } @@ -243,7 +243,7 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\AbstractExpectatio Assert::assertEquals($expectation->third, $third, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $first, $second, $third, $expectation); } return $expectation->return; diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractMixedExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractMixedExpectation.php.stub index 424af8af..5177ac32 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractMixedExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractMixedExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractMixedExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractNoReturnExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractNoReturnExpectation.php.stub index 6a3e6c5d..df17d795 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractNoReturnExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractNoReturnExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractNoReturnExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocBoolExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocBoolExpectation.php.stub index 78edc937..a5095e3e 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocBoolExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocBoolExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractPhpDocBoolExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,\Closure,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocFloatExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocFloatExpectation.php.stub index 87686e0b..c8e9122a 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocFloatExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocFloatExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractPhpDocFloatExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocMixedExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocMixedExpectation.php.stub index bf4fdd3a..d3ce26de 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocMixedExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocMixedExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractPhpDocMixedExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocStaticExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocStaticExpectation.php.stub index 0e957682..9bf9a440 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocStaticExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocStaticExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractPhpDocStaticExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocStringExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocStringExpectation.php.stub index 00e9652e..820af02b 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocStringExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocStringExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractPhpDocStringExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocThisExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocThisExpectation.php.stub index d273cda8..26962dcb 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocThisExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocThisExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractPhpDocThisExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(string,int,bool,self):void|null $hook */ public function __construct( public readonly string $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocThisParamsExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocThisParamsExpectation.php.stub index 3abf9b69..7210035d 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocThisParamsExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractPhpDocThisParamsExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractPhpDocThisParamsExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractSelfExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractSelfExpectation.php.stub index 1d713e06..115c164f 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractSelfExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractSelfExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractSelfExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(string,int,bool,self):void|null $hook */ public function __construct( public readonly string $first, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractSelfViaClassExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractSelfViaClassExpectation.php.stub index 179bc656..7ceaa803 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractSelfViaClassExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractSelfViaClassExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class MultiFunctionContractSelfViaClassExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(mixed,mixed,mixed,self):void|null $hook */ public function __construct( public readonly mixed $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractAssert.php.stub index 6ce63d53..1f5104bd 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractAssert.php.stub @@ -52,7 +52,7 @@ class TestActionContractAssert extends \LaraStrict\Testing\AbstractExpectationCa Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); } } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractExpectation.php.stub index e701e26f..c2e65d5b 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class TestActionContractExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $int, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionExpectation.php.stub index 384acd1b..22dbee49 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class TestActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $int, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractAssert.php.stub index c0824267..6e60ac46 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractAssert.php.stub @@ -52,7 +52,7 @@ class TestReturnActionContractAssert extends \LaraStrict\Testing\AbstractExpecta Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); } return $expectation->return; diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractExpectation.php.stub index ef964264..7821cec0 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class TestReturnActionContractExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly ?int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionExpectation.php.stub index 340f3029..ca6b1fd1 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class TestReturnActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly ?int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnIntersectionActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnIntersectionActionExpectation.php.stub index f30e9aea..c5c039e2 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnIntersectionActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnIntersectionActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class TestReturnIntersectionActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly \ArrayAccess&\Illuminate\Support\Enumerable $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnRequiredActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnRequiredActionExpectation.php.stub index 844eb777..7f3ef3a3 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnRequiredActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnRequiredActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class TestReturnRequiredActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly int $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnUnionActionExpectation.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnUnionActionExpectation.php.stub index 6e3170f4..f29b0696 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnUnionActionExpectation.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnUnionActionExpectation.php.stub @@ -7,7 +7,7 @@ namespace App\Integration\LaraStrict\Feature\Testing\Commands\MakeExpectationCom final class TestReturnUnionActionExpectation { /** - * @param \Closure(self):void|null $hook + * @param \Closure(int,string,mixed,\LaraStrict\Enums\EnvironmentType,\LaraStrict\Testing\Laravel\TestingApplication,string|int,string|int|null,string|int|null,string,string,string,int,\LaraStrict\Enums\EnvironmentType,mixed,string,\LaraStrict\Testing\Laravel\TestingApplication,ArrayAccess&Illuminate\Support\Enumerable,self):void|null $hook */ public function __construct( public readonly \LaraStrict\Testing\Laravel\TestingApplication|string|int|null $return, diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommandRealTest.php b/tests/Feature/Testing/Commands/MakeExpectationCommandRealTest.php index 79e54c0d..dc38d769 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommandRealTest.php +++ b/tests/Feature/Testing/Commands/MakeExpectationCommandRealTest.php @@ -62,8 +62,11 @@ public function testGeneratedFiles(): void $assert = new SimpleActionContractAssert([ new SimpleActionContractExpectation('test', 2, false), new SimpleActionContractExpectation('test2', 1, true, hook: function ( + string $first, + int $second, + bool $third, SimpleActionContractExpectation $expectation - ) use (&$hookCalled) { + ) use (&$hookCalled): void { $hookCalled = true; $this->assertEquals(1, $expectation->second); }),