Code Duplication    Length = 5-5 lines in 4 locations

src/voku/helper/HtmlMinDomObserverOptimizeAttributes.php 4 locations

@@ 195-199 (lines=5) @@
192
        }
193
194
        // remove deprecated anchor-jump
195
        if ($htmlMin->isDoRemoveDeprecatedAnchorName()) {
196
            /** @noinspection NestedPositiveIfStatementsInspection */
197
            if ($tag === 'a' && $attrName === 'name' && isset($allAttr['id']) && $allAttr['id'] === $attrValue) {
198
                return true;
199
            }
200
        }
201
202
        // remove "type=text/css" for css links
@@ 203-207 (lines=5) @@
200
        }
201
202
        // remove "type=text/css" for css links
203
        if ($htmlMin->isDoRemoveDeprecatedTypeFromStylesheetLink()) {
204
            /** @noinspection NestedPositiveIfStatementsInspection */
205
            if ($tag === 'link' && $attrName === 'type' && $attrValue === 'text/css' && isset($allAttr['rel']) && $allAttr['rel'] === 'stylesheet') {
206
                return true;
207
            }
208
        }
209
210
        // remove deprecated script-mime-types
@@ 211-215 (lines=5) @@
208
        }
209
210
        // remove deprecated script-mime-types
211
        if ($htmlMin->isDoRemoveDeprecatedTypeFromScriptTag()) {
212
            /** @noinspection NestedPositiveIfStatementsInspection */
213
            if ($tag === 'script' && $attrName === 'type' && isset($allAttr['src'], self::$executableScriptsMimeTypes[$attrValue])) {
214
                return true;
215
            }
216
        }
217
218
        // remove 'value=""' from <input type="text">
@@ 219-223 (lines=5) @@
216
        }
217
218
        // remove 'value=""' from <input type="text">
219
        if ($htmlMin->isDoRemoveValueFromEmptyInput()) {
220
            /** @noinspection NestedPositiveIfStatementsInspection */
221
            if ($tag === 'input' && $attrName === 'value' && $attrValue === '' && isset($allAttr['type']) && $allAttr['type'] === 'text') {
222
                return true;
223
            }
224
        }
225
226
        // remove some empty attributes