Code Duplication    Length = 9-10 lines in 2 locations

vendor/composer/ClassLoader.php 2 locations

@@ 170-178 (lines=9) @@
167
                    (array) $paths
168
                );
169
            }
170
        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
            // Register directories for a new namespace.
172
            $length = strlen($prefix);
173
            if ('\\' !== $prefix[$length - 1]) {
174
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
            }
176
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
178
        } elseif ($prepend) {
179
            // Prepend directories for an already registered namespace.
180
            $this->prefixDirsPsr4[$prefix] = array_merge(
181
                (array) $paths,
@@ 220-229 (lines=10) @@
217
     */
218
    public function setPsr4($prefix, $paths)
219
    {
220
        if (!$prefix) {
221
            $this->fallbackDirsPsr4 = (array) $paths;
222
        } else {
223
            $length = strlen($prefix);
224
            if ('\\' !== $prefix[$length - 1]) {
225
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
            }
227
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
229
        }
230
    }
231
232
    /**