1 | <?php |
||
23 | class Checker |
||
24 | { |
||
25 | /** @var string a string to check */ |
||
26 | private $string = ''; |
||
27 | |||
28 | /** |
||
29 | * Sets an empty string if the parameter has the wrong type. |
||
30 | * |
||
31 | * @param string $string a string to check |
||
32 | */ |
||
33 | 28 | public function setString($string = '') |
|
45 | |||
46 | /** |
||
47 | * Gets the string. |
||
48 | * |
||
49 | * @return string the string |
||
50 | */ |
||
51 | 28 | public function getString() |
|
55 | |||
56 | /** |
||
57 | * Confirms if a string is an existing absolute path. |
||
58 | * |
||
59 | * @return bool true if the string is an existing absolute path, false otherwise |
||
60 | */ |
||
61 | 10 | public function isValidAbsolutePath() |
|
73 | |||
74 | /** |
||
75 | * Confirms if a string is a valid regular expression. |
||
76 | * |
||
77 | * @return bool true if the string is a valid regex, false otherwise |
||
78 | */ |
||
79 | 20 | public function isValidRegex() |
|
93 | |||
94 | /** |
||
95 | * Throws an exception instead of a warning. |
||
96 | * |
||
97 | * @param int $errno error code of a bad preg_match call |
||
98 | * @param string $errstr error message of a bad preg_match call |
||
99 | * |
||
100 | * @throws InvalidArgumentException [<description>] |
||
101 | */ |
||
102 | 4 | private function warningOnPregMatch($errno, $errstr) |
|
106 | |||
107 | /** |
||
108 | * Confirms if a valid regex string contains a key and a value named suppattern. |
||
109 | * |
||
110 | * A simple directive matcher MUST contain a key and a value named subpattern. |
||
111 | * A starting block directive matcher MUST contain a key and a value named subpattern. |
||
112 | * |
||
113 | * @return bool true if the string is valid, false otherwise |
||
114 | */ |
||
115 | 17 | public function hasKeyAndValueSubPattern() |
|
127 | } |
||
128 |