1 | <?php |
||
21 | class Runner |
||
22 | { |
||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $callbacks; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $groups; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $regexp = '((?!))'; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $regexps; |
||
42 | |||
43 | /** |
||
44 | * Constructor |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public function __construct() |
||
52 | |||
53 | /** |
||
54 | * Convert given XPath expression to PHP |
||
55 | * |
||
56 | * @param string $expr |
||
57 | * @return string |
||
58 | */ |
||
59 | public function convert($expr) |
||
74 | |||
75 | /** |
||
76 | * Set the list of convertors used by this instance |
||
77 | * |
||
78 | * @param AbstractConvertor[] $convertors |
||
79 | * @return void |
||
80 | */ |
||
81 | public function setConvertors(array $convertors) |
||
103 | |||
104 | /** |
||
105 | * Add a convertor to the list used by this instance |
||
106 | * |
||
107 | * @param AbstractConvertor $convertor |
||
108 | * @return void |
||
109 | */ |
||
110 | protected function addConvertor(AbstractConvertor $convertor) |
||
127 | |||
128 | /** |
||
129 | * Get the list of arguments produced by a regexp's match |
||
130 | * |
||
131 | * @param string[] $matches Regexp matches |
||
132 | * @param string $name Regexp name |
||
133 | * @return string[] |
||
134 | */ |
||
135 | protected function getArguments(array $matches, $name) |
||
147 | |||
148 | /** |
||
149 | * Return the default list of convertors |
||
150 | * |
||
151 | * @return AbstractConvertor[] |
||
152 | */ |
||
153 | protected function getDefaultConvertors() |
||
170 | |||
171 | /** |
||
172 | * Insert capture names into given regexp |
||
173 | * |
||
174 | * @param string $name Name of the regexp, used to name captures |
||
175 | * @param string $regexp Original regexp |
||
176 | * @return string Modified regexp |
||
177 | */ |
||
178 | protected function insertCaptureNames($name, $regexp) |
||
191 | |||
192 | /** |
||
193 | * Sort regexps by length |
||
194 | * |
||
195 | * @return void |
||
196 | */ |
||
197 | protected function sortRegexps() |
||
207 | } |