1313use Overblog \GraphQLBundle \Relay \Connection \ConnectionBuilder ;
1414use Overblog \GraphQLBundle \Relay \Connection \ConnectionInterface ;
1515use Overblog \GraphQLBundle \Relay \Connection \PageInfoInterface ;
16+ use UnexpectedValueException ;
1617
1718/**
1819 * @phpstan-template T
@@ -48,15 +49,15 @@ public static function fromConnection(ConnectionInterface|Promise $connection, A
4849 {
4950 $ connection = self ::resolvePromise (
5051 $ connection ,
51- static fn ($ resolved ) => $ resolved instanceof ConnectionInterface,
52+ static fn ($ resolved ): bool => $ resolved instanceof ConnectionInterface,
5253 'Resolved result is not a ConnectionInterface '
5354 );
5455
5556 $ return = new self ($ connection ->getEdges (), $ connection ->getPageInfo ());
5657
5758 $ totalCount = self ::resolvePromise (
5859 $ connection ->getTotalCount (),
59- static fn ($ resolved ) => is_int ($ resolved ) || null === $ resolved ,
60+ static fn ($ resolved ): bool => is_int ($ resolved ) || null === $ resolved ,
6061 'Resolved result is not an int or null '
6162 );
6263
@@ -82,7 +83,7 @@ private static function resolvePromise(mixed $value, callable $validator, string
8283 $ resolvedValue = $ promiseAdapter ->wait ($ value );
8384
8485 if (!$ validator ($ resolvedValue )) {
85- throw new \ UnexpectedValueException ($ errorMessage );
86+ throw new UnexpectedValueException ($ errorMessage );
8687 }
8788
8889 return $ resolvedValue ;
0 commit comments