Assure unserialized NodeProviderCollection contains only valid elements

This stops Psalm from complaining about MixedPropertyTypeCoercion
This commit is contained in:
Paweł Słowik
2021-05-24 22:48:58 +02:00
parent 7e4909e764
commit fe475968db
+6 -1
View File
@@ -50,6 +50,11 @@ class NodeProviderCollection extends AbstractCollection
],
]);
$this->data = $data;
$this->data = array_filter(
$data,
function ($unserialized): bool {
return $unserialized instanceof NodeProviderInterface;
}
);
}
}