Code Duplication    Length = 10-10 lines in 2 locations

src/Rules/ContainText.php 1 location

@@ 44-53 (lines=10) @@
41
    /**
42
     * @inheritdoc
43
     */
44
    public function arguments_are_valid(array &$arguments) {
45
        if (count($arguments) != 1) {
46
            return false;
47
        }
48
        $regexp = $arguments[0];
49
        if (!is_string($regexp) || @preg_match("%$regexp%", "") === false) {
50
            return false;
51
        }
52
        return true;
53
    }
54
55
    /**
56
     * @inheritdoc

src/Variables/Name.php 1 location

@@ 38-47 (lines=10) @@
35
    /**
36
     * @inheritdocs
37
     */
38
    public function arguments_are_valid(array &$arguments) {
39
        if (count($arguments) != 1) {
40
            return false;
41
        }
42
        $regexp = $arguments[0];
43
        if (!is_string($regexp) || @preg_match("%^$regexp\$%", "") === false) {
44
            return false;
45
        }
46
        return true;
47
    }
48
49
    /**
50
     * @inheritdocs