Code Duplication    Length = 10-10 lines in 2 locations

src/Rules/ContainText.php 1 location

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

src/Variables/Name.php 1 location

@@ 46-55 (lines=10) @@
43
     * @param   array   $arguments
44
     * @return  bool 
45
     */
46
    public function arguments_are_valid(array &$arguments) {
47
        if (count($arguments) != 1) {
48
            return false;
49
        }
50
        $regexp = $arguments[0];
51
        if (!is_string($regexp) || @preg_match("%$regexp%", "") === false) {
52
            return false;
53
        }
54
        return true;
55
    }
56
57
    /**
58
     * Compile the property to an SQL expression.