Code Duplication    Length = 13-14 lines in 2 locations

Provider/PagerProviderRegistry.php 1 location

@@ 66-78 (lines=13) @@
63
     *
64
     * @throws \InvalidArgumentException if no providers were registered for the index
65
     */
66
    public function getIndexProviders($index)
67
    {
68
        if (!isset($this->providers[$index])) {
69
            throw new \InvalidArgumentException(sprintf('No providers were registered for index "%s".', $index));
70
        }
71
72
        $providers = [];
73
        foreach ($this->providers[$index] as $type => $providerId) {
74
            $providers[$type] = $this->getProvider($index, $type);
75
        }
76
77
        return $providers;
78
    }
79
80
    /**
81
     * Gets the provider for an index and type.

Provider/ProviderRegistry.php 1 location

@@ 76-89 (lines=14) @@
73
     *
74
     * @throws \InvalidArgumentException if no providers were registered for the index
75
     */
76
    public function getIndexProviders($index)
77
    {
78
        if (!isset($this->providers[$index])) {
79
            throw new \InvalidArgumentException(sprintf('No providers were registered for index "%s".', $index));
80
        }
81
82
        $providers = [];
83
84
        foreach ($this->providers[$index] as $type => $providerId) {
85
            $providers[$type] = $this->container->get($providerId);
86
        }
87
88
        return $providers;
89
    }
90
91
    /**
92
     * Gets the provider for an index and type.