Code Duplication    Length = 5-6 lines in 2 locations

src/View/View.php 2 locations

@@ 140-145 (lines=6) @@
137
            return $this->extensions->get($method);
138
        }
139
140
        if (starts_with($name, 'set') && $this->extensions->has($method)) {
141
            $extension = $this->extensions->get($method);
142
            call_user_func_array([$extension, 'set'], $parameters);
143
144
            return $this;
145
        }
146
147
        if (starts_with($name, 'add') && $this->extensions->has(str_plural($method))) {
148
            $extension = $this->extensions->get(str_plural($method));
@@ 147-151 (lines=5) @@
144
            return $this;
145
        }
146
147
        if (starts_with($name, 'add') && $this->extensions->has(str_plural($method))) {
148
            $extension = $this->extensions->get(str_plural($method));
149
            call_user_func_array([$extension, 'add'], $parameters);
150
            return $this;
151
        }
152
153
        throw new \BadMethodCallException("Call to undefined method [{$name}]");
154
    }