Skip to content

Commit 73cab33

Browse files
committed
impossible type
1 parent bf79372 commit 73cab33

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/Error/Error.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public function __construct(
9393

9494
// Compute list of blame nodes.
9595
if ($nodes instanceof \Traversable) {
96-
$this->nodes = array_filter(\iterator_to_array($nodes), static fn (?Node $node): bool => $node !== null);
96+
/** @phpstan-ignore arrayFilter.strict */
97+
$this->nodes = array_filter(\iterator_to_array($nodes));
9798
} elseif (\is_array($nodes)) {
9899
$this->nodes = array_filter($nodes);
99100
} elseif ($nodes !== null) {

src/Utils/SchemaPrinter.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ protected static function printFilteredSchema(Schema $schema, callable $directiv
157157
$elements[] = static::printType($type, $options);
158158
}
159159

160-
return \implode("\n\n", \array_filter($elements, fn (?string $element) => $element !== null && $element !== '')) . "\n";
160+
/** @phpstan-ignore arrayFilter.strict */
161+
return \implode("\n\n", \array_filter($elements)) . "\n";
161162
}
162163

163164
/** @throws InvariantViolation */

tests/Utils/BuildSchemaTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1451,15 +1451,15 @@ interface Hello {
14511451
self::assertSame(['Query'], $created);
14521452

14531453
$schema->getType('Color');
1454-
/** @var mixed $created reset the type for PHPStan */
1454+
/** @phpstan-ignore staticMethod.impossibleType */
14551455
self::assertSame(['Query', 'Color'], $created);
14561456

14571457
$schema->getType('Hello');
1458-
/** @var mixed $created reset the type for PHPStan */
1458+
/** @phpstan-ignore staticMethod.impossibleType */
14591459
self::assertSame(['Query', 'Color', 'Hello'], $created);
14601460

14611461
$types = $schema->getTypeMap();
1462-
/** @var mixed $created reset the type for PHPStan */
1462+
/** @phpstan-ignore staticMethod.impossibleType */
14631463
self::assertSame(['Query', 'Color', 'Hello', 'World'], $created);
14641464

14651465
self::assertArrayHasKey('Query', $types);

0 commit comments

Comments
 (0)