Skip to content

Commit

Permalink
bot: fix cs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Jan 1, 2025
1 parent d7d53f1 commit ac5afe0
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions tests/CallbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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;
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit ac5afe0

Please sign in to comment.