Code Duplication    Length = 9-10 lines in 2 locations

vendor/composer/ClassLoader.php 2 locations

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