| 1 | <?php |
||
| 4 | class Glob |
||
| 5 | { |
||
| 6 | /** |
||
| 7 | * @var string |
||
| 8 | */ |
||
| 9 | private $glob; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @param string $glob |
||
| 13 | */ |
||
| 14 | 32 | public function __construct($glob) |
|
| 18 | |||
| 19 | /** |
||
| 20 | * Encode raw string value |
||
| 21 | * |
||
| 22 | * @param string $value |
||
| 23 | * @return string |
||
| 24 | */ |
||
| 25 | 30 | public static function encode($value) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * Returns raw glob |
||
| 32 | * |
||
| 33 | * @return string |
||
| 34 | */ |
||
| 35 | 7 | public function __toString() |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Returns RQL representation |
||
| 42 | * |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 7 | public function toRql() |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Returns RegExp representation |
||
| 63 | * |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | 7 | public function toRegex() |
|
| 78 | |||
| 79 | /** |
||
| 80 | * Returns LIKE representation |
||
| 81 | * |
||
| 82 | * @return string |
||
| 83 | */ |
||
| 84 | 7 | public function toLike() |
|
| 94 | |||
| 95 | 21 | private function decoder($many, $one, callable $escaper) |
|
| 111 | } |
||
| 112 |