Skip to content

Commit 5dbe5d6

Browse files
committed
Applied code review suggestions
1 parent 2e86243 commit 5dbe5d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/Relay/PageAwareConnection.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Overblog\GraphQLBundle\Relay\Connection\ConnectionBuilder;
1414
use Overblog\GraphQLBundle\Relay\Connection\ConnectionInterface;
1515
use 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

Comments
 (0)