Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.4.x' into 2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 26, 2024
2 parents 3eb61a0 + f7d5782 commit 4f260f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Type/Symfony/InputBagTypeSpecifyingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getClass(): string

public function isMethodSupported(MethodReflection $methodReflection, MethodCall $node, TypeSpecifierContext $context): bool
{
return $methodReflection->getName() === self::HAS_METHOD_NAME && !$context->null();
return $methodReflection->getName() === self::HAS_METHOD_NAME && $context->false();
}

public function specifyTypes(MethodReflection $methodReflection, MethodCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes
Expand Down
3 changes: 2 additions & 1 deletion tests/Type/Symfony/data/input_bag.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
assertType('bool|float|int|string|null', $bag->get('foo'));

if ($bag->has('foo')) {
assertType('bool|float|int|string', $bag->get('foo'));
// Because `has` rely on `array_key_exists` we can still have set the NULL value.
assertType('bool|float|int|string|null', $bag->get('foo'));
assertType('bool|float|int|string|null', $bag->get('bar'));
} else {
assertType('null', $bag->get('foo'));
Expand Down

0 comments on commit 4f260f0

Please sign in to comment.