mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
parent
2d0758ab10
commit
f5d7f6c405
@ -1088,7 +1088,8 @@ class Union implements TypeNode
|
||||
}
|
||||
|
||||
if ($atomic_type instanceof Type\Atomic\TNamedObject
|
||||
&& $atomic_type->value !== 'SimpleXMLElement') {
|
||||
&& $atomic_type->value !== 'SimpleXMLElement'
|
||||
&& $atomic_type->value !== 'SimpleXMLIterator') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2821,6 +2821,17 @@ class ConditionalTest extends \Psalm\Tests\TestCase
|
||||
function b(B $_b): void {
|
||||
}',
|
||||
],
|
||||
'SimpleXMLIteratorNotAlwaysTruthy' => [
|
||||
'<?php
|
||||
$lilstring = "";
|
||||
|
||||
$n = new SimpleXMLElement($lilstring);
|
||||
$n = $n->children();
|
||||
|
||||
if (!$n) {
|
||||
echo "false";
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -146,6 +146,8 @@ class ReconcilerTest extends \Psalm\Tests\TestCase
|
||||
'filterKeyedArrayWithIterable' => ['array{some: string}', 'iterable<string>', 'array{some: mixed}'],
|
||||
'SimpleXMLElementNotAlwaysTruthy' => ['SimpleXMLElement', '!falsy', 'SimpleXMLElement'],
|
||||
'SimpleXMLElementNotAlwaysTruthy2' => ['SimpleXMLElement', 'falsy', 'SimpleXMLElement'],
|
||||
'SimpleXMLIteratorNotAlwaysTruthy' => ['SimpleXMLIterator', '!falsy', 'SimpleXMLIterator'],
|
||||
'SimpleXMLIteratorNotAlwaysTruthy2' => ['SimpleXMLIterator', 'falsy', 'SimpleXMLIterator'],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user