Code Duplication    Length = 5-5 lines in 4 locations

src/voku/helper/HtmlMinDomObserverOptimizeAttributes.php 4 locations

@@ 175-179 (lines=5) @@
172
        }
173
174
        // remove deprecated anchor-jump
175
        if ($htmlMin->isDoRemoveDeprecatedAnchorName()) {
176
            /** @noinspection NestedPositiveIfStatementsInspection */
177
            if ($tag === 'a' && $attrName === 'name' && isset($allAttr['id']) && $allAttr['id'] === $attrValue) {
178
                return true;
179
            }
180
        }
181
182
        // remove "type=text/css" for css links
@@ 183-187 (lines=5) @@
180
        }
181
182
        // remove "type=text/css" for css links
183
        if ($htmlMin->isDoRemoveDeprecatedTypeFromStylesheetLink()) {
184
            /** @noinspection NestedPositiveIfStatementsInspection */
185
            if ($tag === 'link' && $attrName === 'type' && $attrValue === 'text/css' && isset($allAttr['rel']) && $allAttr['rel'] === 'stylesheet') {
186
                return true;
187
            }
188
        }
189
190
        // remove deprecated script-mime-types
@@ 191-195 (lines=5) @@
188
        }
189
190
        // remove deprecated script-mime-types
191
        if ($htmlMin->isDoRemoveDeprecatedTypeFromScriptTag()) {
192
            /** @noinspection NestedPositiveIfStatementsInspection */
193
            if ($tag === 'script' && $attrName === 'type' && isset($allAttr['src'], self::$executableScriptsMimeTypes[$attrValue])) {
194
                return true;
195
            }
196
        }
197
198
        // remove 'value=""' from <input type="text">
@@ 199-203 (lines=5) @@
196
        }
197
198
        // remove 'value=""' from <input type="text">
199
        if ($htmlMin->isDoRemoveValueFromEmptyInput()) {
200
            /** @noinspection NestedPositiveIfStatementsInspection */
201
            if ($tag === 'input' && $attrName === 'value' && $attrValue === '' && isset($allAttr['type']) && $allAttr['type'] === 'text') {
202
                return true;
203
            }
204
        }
205
206
        // remove some empty attributes