13
13
use Overblog \GraphQLBundle \Relay \Connection \ConnectionBuilder ;
14
14
use Overblog \GraphQLBundle \Relay \Connection \ConnectionInterface ;
15
15
use Overblog \GraphQLBundle \Relay \Connection \PageInfoInterface ;
16
+ use UnexpectedValueException ;
16
17
17
18
/**
18
19
* @phpstan-template T
@@ -48,15 +49,15 @@ public static function fromConnection(ConnectionInterface|Promise $connection, A
48
49
{
49
50
$ connection = self ::resolvePromise (
50
51
$ connection ,
51
- static fn ($ resolved ) => $ resolved instanceof ConnectionInterface,
52
+ static fn ($ resolved ): bool => $ resolved instanceof ConnectionInterface,
52
53
'Resolved result is not a ConnectionInterface '
53
54
);
54
55
55
56
$ return = new self ($ connection ->getEdges (), $ connection ->getPageInfo ());
56
57
57
58
$ totalCount = self ::resolvePromise (
58
59
$ connection ->getTotalCount (),
59
- static fn ($ resolved ) => is_int ($ resolved ) || null === $ resolved ,
60
+ static fn ($ resolved ): bool => is_int ($ resolved ) || null === $ resolved ,
60
61
'Resolved result is not an int or null '
61
62
);
62
63
@@ -82,7 +83,7 @@ private static function resolvePromise(mixed $value, callable $validator, string
82
83
$ resolvedValue = $ promiseAdapter ->wait ($ value );
83
84
84
85
if (!$ validator ($ resolvedValue )) {
85
- throw new \ UnexpectedValueException ($ errorMessage );
86
+ throw new UnexpectedValueException ($ errorMessage );
86
87
}
87
88
88
89
return $ resolvedValue ;
0 commit comments