Skip to content

Commit

Permalink
misc: remove unneeded closure conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
romm committed Feb 16, 2024
1 parent 1688bc6 commit 972e657
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/StaticAnalysis/inferring-types-with-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace CuyZ\Valinor\Tests\StaticAnalysis;

use Closure;
use CuyZ\Valinor\Mapper\ArgumentsMapper;
use CuyZ\Valinor\Mapper\TreeMapper;

Expand Down Expand Up @@ -53,15 +52,15 @@ function mapping_function_arguments_will_infer_object_of_same_type(ArgumentsMapp

function mapping_static_method_arguments_will_infer_object_of_same_type(ArgumentsMapper $mapper): void
{
$result = $mapper->mapArguments(Closure::fromCallable(SomeClass::someStaticMethod(...)), []);
$result = $mapper->mapArguments(SomeClass::someStaticMethod(...), []);

/** @psalm-check-type $result = array{foo: string, bar?: int|null} */
assertType('array{foo: string, bar?: int|null}', $result);
}

function mapping_method_arguments_will_infer_object_of_same_type(ArgumentsMapper $mapper): void
{
$result = $mapper->mapArguments(Closure::fromCallable((new SomeClass())->someMethod(...)), []);
$result = $mapper->mapArguments((new SomeClass())->someMethod(...), []);

/** @psalm-check-type $result = array{foo: string, bar?: int|null} */
assertType('array{foo: string, bar?: int|null}', $result);
Expand Down

0 comments on commit 972e657

Please sign in to comment.