Code Duplication    Length = 3-5 lines in 2 locations

src/Rules/Html/RegExExistsRule.php 2 locations

@@ 49-51 (lines=3) @@
46
            if ($regEx['isRegEx']) {
47
                $pattern = str_replace('', '\\~', $regEx['pattern']);
48
49
                if (preg_match('~' . $pattern . '~', (string)$response->getBody()) === 0) {
50
                    $errors[] = 'Regular expression: ' . $regEx['pattern'];
51
                }
52
            } else {
53
                if (preg_match('^' . preg_quote($regEx['pattern']) . '^', (string)$response->getBody()) === 0) {
54
                    $errors[] = 'Text: ' . $regEx['pattern'];
@@ 52-56 (lines=5) @@
49
                if (preg_match('~' . $pattern . '~', (string)$response->getBody()) === 0) {
50
                    $errors[] = 'Regular expression: ' . $regEx['pattern'];
51
                }
52
            } else {
53
                if (preg_match('^' . preg_quote($regEx['pattern']) . '^', (string)$response->getBody()) === 0) {
54
                    $errors[] = 'Text: ' . $regEx['pattern'];
55
                }
56
            }
57
        }
58
59
        if (count($errors) > 0) {