From ac5afe0ff14836850384c86335ecc6f23e3b7008 Mon Sep 17 00:00:00 2001 From: kbond Date: Wed, 1 Jan 2025 01:15:47 +0000 Subject: [PATCH] bot: fix cs [skip ci] --- tests/CallbackTest.php | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tests/CallbackTest.php b/tests/CallbackTest.php index 1bca4ca..21a836c 100644 --- a/tests/CallbackTest.php +++ b/tests/CallbackTest.php @@ -102,13 +102,11 @@ public function invoke_all_primitive_typed_argument(): void public function invoke_all_class_arguments(): void { $object = new Object2(); - $function = static function(Object1 $object1, Object2 $object2, $object3) { - return [ - 'object1' => $object1, - 'object2' => $object2, - 'object3' => $object3, - ]; - }; + $function = static fn(Object1 $object1, Object2 $object2, $object3) => [ + 'object1' => $object1, + 'object2' => $object2, + 'object3' => $object3, + ]; $actual = Callback::createFor($function) ->invokeAll(Parameter::union( @@ -132,13 +130,11 @@ public function invoke_all_class_arguments(): void */ public function invoke_all_class_arguments_value_factories(): void { - $function = static function(Object1 $object1, Object2 $object2, $object3) { - return [ - 'object1' => $object1, - 'object2' => $object2, - 'object3' => $object3, - ]; - }; + $function = static fn(Object1 $object1, Object2 $object2, $object3) => [ + 'object1' => $object1, + 'object2' => $object2, + 'object3' => $object3, + ]; $factoryArgs = []; $factory = Parameter::factory(static function($arg) use (&$factoryArgs) { $factoryArgs[] = $arg; @@ -223,14 +219,12 @@ public function invoke_with_non_parameters(): void public function invoke_with_resolvable_args(): void { $object = new Object2(); - $function = static function(Object1 $object1, Object2 $object2, $object3, $extra) { - return [ - 'object1' => $object1, - 'object2' => $object2, - 'object3' => $object3, - 'extra' => $extra, - ]; - }; + $function = static fn(Object1 $object1, Object2 $object2, $object3, $extra) => [ + 'object1' => $object1, + 'object2' => $object2, + 'object3' => $object3, + 'extra' => $extra, + ]; $actual = Callback::createFor($function) ->invoke(