1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Prevent check triggering for commonly-extended classes

This commit is contained in:
Matt Brown 2021-02-07 01:24:08 -05:00
parent f2d202e2bb
commit 049b2c3f7a

View File

@ -2082,10 +2082,12 @@ class ClassAnalyzer extends ClassLikeAnalyzer
if ($fq_interface_name_lc === 'traversable'
&& !$storage->abstract
&& !(
isset($storage->class_implements['iteratoraggregate'])
|| isset($storage->class_implements['iterator'])
)
&& !isset($storage->class_implements['iteratoraggregate'])
&& !isset($storage->class_implements['iterator'])
&& !isset($storage->parent_classes['pdostatement'])
&& !isset($storage->parent_classes['ds\collection'])
&& !isset($storage->parent_classes['domnodelist'])
&& !isset($storage->parent_classes['dateperiod'])
) {
if (IssueBuffer::accepts(
new InvalidTraversableImplementation(