Skip to content
Snippets Groups Projects
Commit 4672dc9a authored by catch's avatar catch
Browse files

Issue #3456311 by jonathanshaw, mxh: Make LazyPluginCollection::getIterator...

Issue #3456311 by jonathanshaw, mxh: Make LazyPluginCollection::getIterator more flexible, return a Traversable
parent a3e346ee
Branches
Tags
3 merge requests!12628#3524738 backport without deprecation,!12477#3532243: JSON support status during updates,!5423Draft: Resolve #3329907 "Test2"
Pipeline #503793 passed with warnings
Pipeline: drupal

#503795

    ......@@ -1051,12 +1051,6 @@
    'count' => 1,
    'path' => __DIR__ . '/lib/Drupal/Component/Plugin/LazyPluginCollection.php',
    ];
    $ignoreErrors[] = [
    'message' => '#^Method Drupal\\\\Component\\\\Plugin\\\\LazyPluginCollection\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#',
    'identifier' => 'missingType.generics',
    'count' => 1,
    'path' => __DIR__ . '/lib/Drupal/Component/Plugin/LazyPluginCollection.php',
    ];
    $ignoreErrors[] = [
    'message' => '#^Method Drupal\\\\Component\\\\Plugin\\\\LazyPluginCollection\\:\\:initializePlugin\\(\\) has no return type specified\\.$#',
    'identifier' => 'missingType.return',
    ......@@ -142,7 +142,11 @@ public function removeInstanceId($instance_id) {
    $this->remove($instance_id);
    }
    public function getIterator(): \ArrayIterator {
    /**
    * @return \Traversable<string, mixed>
    * A traversable generator.
    */
    public function getIterator(): \Traversable {
    $instances = [];
    foreach ($this->getInstanceIds() as $instance_id) {
    $instances[$instance_id] = $this->get($instance_id);
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment