| 1 | <?php |
||
| 12 | class Expression |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Raw definition |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $raw; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Rule pattern |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $pattern; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Initialize expression |
||
| 28 | * @param string $rule |
||
| 29 | */ |
||
| 30 | public function __construct($rule, $operator = self::ALLOW) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Retrieve the raw rule definition |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public function getRaw() |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Transform current pattern to be used for matching |
||
| 46 | * @param string $raw |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | private function build() |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Check if current expression is contained in another |
||
| 66 | * @param Expression $exp |
||
| 67 | * @return boolean |
||
| 68 | */ |
||
| 69 | public function contained(Expression $exp) |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Check if current expression contains another |
||
| 76 | * @param Expression $exp |
||
| 77 | * @return boolean |
||
| 78 | */ |
||
| 79 | public function contains(Expression $exp) |
||
| 83 | |||
| 84 | /** |
||
| 85 | * Retrieve the regex pattern corresponding to the Expression |
||
| 86 | * @return string |
||
| 87 | */ |
||
| 88 | public function getPattern() |
||
| 93 | |||
| 94 | /** |
||
| 95 | * Transform expression to string |
||
| 96 | * @return string |
||
| 97 | */ |
||
| 98 | public function __toString() |
||
| 102 | } |
||
| 103 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.