Code Duplication    Length = 11-15 lines in 2 locations

exercises/dependency-heaven/solution/vendor/composer/ClassLoader.php 2 locations

@@ 110-124 (lines=15) @@
107
     */
108
    public function add($prefix, $paths, $prepend = false)
109
    {
110
        if (!$prefix) {
111
            if ($prepend) {
112
                $this->fallbackDirsPsr0 = array_merge(
113
                    (array) $paths,
114
                    $this->fallbackDirsPsr0
115
                );
116
            } else {
117
                $this->fallbackDirsPsr0 = array_merge(
118
                    $this->fallbackDirsPsr0,
119
                    (array) $paths
120
                );
121
            }
122
123
            return;
124
        }
125
126
        $first = $prefix[0];
127
        if (!isset($this->prefixesPsr0[$first][$prefix])) {
@@ 159-169 (lines=11) @@
156
    {
157
        if (!$prefix) {
158
            // Register directories for the root namespace.
159
            if ($prepend) {
160
                $this->fallbackDirsPsr4 = array_merge(
161
                    (array) $paths,
162
                    $this->fallbackDirsPsr4
163
                );
164
            } else {
165
                $this->fallbackDirsPsr4 = array_merge(
166
                    $this->fallbackDirsPsr4,
167
                    (array) $paths
168
                );
169
            }
170
        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
            // Register directories for a new namespace.
172
            $length = strlen($prefix);