-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TMP][WiP] IBX-8470: Upgraded codebase to Symfony 6 #76
base: main
Are you sure you want to change the base?
Conversation
0d56ab0
to
fd68e87
Compare
Quality Gate passedIssues Measures |
$return->totalCount = $connection->totalCount; | ||
$connection = self::resolvePromise( | ||
$connection, | ||
static fn ($resolved) => $resolved instanceof ConnectionInterface, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static fn ($resolved) => $resolved instanceof ConnectionInterface, | |
static fn ($resolved): bool => $resolved instanceof ConnectionInterface, |
|
||
$totalCount = self::resolvePromise( | ||
$connection->getTotalCount(), | ||
static fn ($resolved) => is_int($resolved) || null === $resolved, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static fn ($resolved) => is_int($resolved) || null === $resolved, | |
static fn ($resolved): bool => is_int($resolved) || null === $resolved, |
|
||
private static function resolvePromise(mixed $value, callable $validator, string $errorMessage): mixed | ||
{ | ||
if ($value instanceof Promise) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Early return here.
$resolvedValue = $promiseAdapter->wait($value); | ||
|
||
if (!$validator($resolvedValue)) { | ||
throw new \UnexpectedValueException($errorMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ import
throw new \UnexpectedValueException($errorMessage); | |
throw new UnexpectedValueException($errorMessage); |
Description:
For QA:
Documentation: