-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Add missing types to the codebase #433
Conversation
Comparison::GT => static fn ($object): bool => self::getObjectFieldValue($object, $field) > $value, | ||
Comparison::GTE => static fn ($object): bool => self::getObjectFieldValue($object, $field) >= $value, | ||
Comparison::IN => static function ($object) use ($field, $value): bool { | ||
Comparison::EQ => static fn (object|array $object): bool => self::getObjectFieldValue($object, $field) === $value, |
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.
This test is the reason why I used array|object
here and below:
collections/tests/ClosureExpressionVisitorTest.php
Lines 415 to 421 in 16dd296
public function testArrayComparison(): void | |
{ | |
$closure = $this->visitor->walkComparison($this->builder->eq('foo', 42)); | |
self::assertTrue($closure(['foo' => 42])); | |
} | |
} |
@@ -178,7 +178,7 @@ public function walkCompositeExpression(CompositeExpression $expr): Closure | |||
/** @param callable[] $expressions */ | |||
private function andExpressions(array $expressions): Closure | |||
{ | |||
return static fn ($object): bool => array_all( | |||
return static fn (object $object): bool => array_all( |
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.
I didn't use object|array
here though. Running the ORM test suite with that type hint causes no issues.
591b9bc
to
03d4e48
Compare
Some of the types were wrongly reverted in f741a20, some others were never added.