Skip to content

Commit d247ef7

Browse files
committed
SA
1 parent 1ef9a68 commit d247ef7

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

GenericDomainCollection.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,11 @@ public function containsKey($key): bool
8989
}
9090

9191
if ($this->elements instanceof \Traversable) {
92+
/** @psalm-suppress InvalidCast */
93+
$key = \is_int($key) ? (string) $key : $key;
9294
foreach ($this->elements as $knownKey => $element) {
93-
if ((string) $key === (string) $knownKey) {
95+
/** @psalm-suppress InvalidCast */
96+
if ($key === (\is_int($knownKey) ? (string) $knownKey : $knownKey)) {
9497
return true;
9598
}
9699
}
@@ -156,8 +159,11 @@ public function get($key)
156159
}
157160

158161
if ($this->elements instanceof \Traversable) {
162+
/** @psalm-suppress InvalidCast */
163+
$key = \is_int($key) ? (string) $key : $key;
159164
foreach ($this->elements as $knownKey => $element) {
160-
if ((string) $key === (string) $knownKey) {
165+
/** @psalm-suppress InvalidCast */
166+
if ($key === (\is_int($knownKey) ? (string) $knownKey : $knownKey)) {
161167
return $element;
162168
}
163169
}

Infrastructure/Config/TreeBuilderHelper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ public static function root(string $name, &$treeBuilder = null): ArrayNodeDefini
2121

2222
/**
2323
* @psalm-suppress RedundantCondition
24+
* @psalm-suppress UndefinedMethod
2425
*
2526
* @var ArrayNodeDefinition
2627
*/
27-
return method_exists($treeBuilder, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root($name, 'array', $builder);
28+
return method_exists($treeBuilder, 'getRootNode')
29+
? $treeBuilder->getRootNode()
30+
: $treeBuilder->root($name, 'array', $builder);
2831
}
2932
}

Tests/Infrastructure/Doctrine/DomainEntityRepositoryTraitTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ public function testAddFieldParameter(): void
4848

4949
$parameters = $qb->getParameters();
5050

51-
/** @psalm-suppress DeprecatedConstant */
51+
/** @psalm-suppress PossiblyNullReference */
5252
self::assertSame(Type::INTEGER, $parameters->get(0)->getType());
53+
/** @psalm-suppress PossiblyNullReference */
5354
self::assertSame(\PDO::PARAM_STR, $parameters->get(1)->getType());
55+
/** @psalm-suppress PossiblyNullReference */
5456
self::assertSame(TestDomainIdType::NAME, $parameters->get(2)->getType());
5557
}
5658

0 commit comments

Comments
 (0)