| Total Complexity | 5 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class HandlersProcessor extends TokenProcessor |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * Creates list of handlers from a string of handlers definition. |
||
| 22 | * |
||
| 23 | * @param string $handlers handlers |
||
| 24 | * @return string[] handlers |
||
| 25 | */ |
||
| 26 | private function makeHandlersList(string $handlers): array |
||
| 27 | { |
||
| 28 | if ($handlers === '') { |
||
| 29 | return []; |
||
| 30 | } |
||
| 31 | $injProcessor = new InjectedStringSuit($handlers); |
||
| 32 | $result = $injProcessor->addSlashes(','); |
||
| 33 | $result = preg_split('{(?<!\\\\),\s*}', $result); |
||
| 34 | foreach ($result as &$handler) { |
||
| 35 | $injProcessor = new InjectedStringSuit(stripcslashes($handler)); |
||
| 36 | $handler = $injProcessor->resolveClassNames($this->namespace); |
||
| 37 | } |
||
| 38 | return $result; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Creates list of handlers for input data. |
||
| 43 | * |
||
| 44 | * @return string[] handlers |
||
| 45 | */ |
||
| 46 | public function processInputData(): array |
||
| 47 | { |
||
| 48 | return $this->makeHandlersList($this->input); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Creates list of handlers for output data. |
||
| 53 | * |
||
| 54 | * @return string[] handlers |
||
| 55 | */ |
||
| 56 | public function processOutputData(): array |
||
| 59 | } |
||
| 60 | } |