Code Duplication    Length = 12-12 lines in 2 locations

src/Minify.php 2 locations

@@ 156-167 (lines=12) @@
153
     *
154
     * @return \ArjanSchouten\HtmlMinifier\Placeholders\PlaceholderInterface[]
155
     */
156
    public function addPlaceholder($placeholder)
157
    {
158
        if (!isset(class_implements($placeholder)[PlaceholderInterface::class])) {
159
            throw new InvalidArgumentException('The class ['.$placeholder.'] should be a member of the ['.PlaceholderInterface::class.']');
160
        } elseif (in_array($placeholder, $this->placeholders)) {
161
            throw new InvalidArgumentException('The placeholder ['.$placeholder.'] is already added to the minifier!');
162
        }
163
164
        $this->placeholders[] = $placeholder;
165
166
        return $this->placeholders;
167
    }
168
169
    /**
170
     * @return \ArjanSchouten\HtmlMinifier\Minifiers\MinifierInterface[]
@@ 184-195 (lines=12) @@
181
     *
182
     * @return \ArjanSchouten\HtmlMinifier\Minifiers\MinifierInterface[]
183
     */
184
    public function addMinifier($minifier)
185
    {
186
        if (!isset(class_implements($minifier)[MinifierInterface::class])) {
187
            throw new InvalidArgumentException('The class ['.$minifier.'] should be a member of the ['.MinifierInterface::class.']');
188
        } elseif (in_array($minifier, $this->minifiers)) {
189
            throw new InvalidArgumentException('The minifier ['.$minifier.'] is already added to the minifier!');
190
        }
191
192
        $this->minifiers[] = $minifier;
193
194
        return $this->minifiers;
195
    }
196
197
    /**
198
     * Get the classname without the namespace.