1 | <?php |
||
21 | final class BashRestController |
||
22 | { |
||
23 | |||
24 | use SecuredTrait; |
||
25 | |||
26 | const SECRET_HEADER = 'X-Secret'; |
||
27 | |||
28 | /** |
||
29 | * @var Executor |
||
30 | */ |
||
31 | private $executor; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private $scripts; |
||
37 | |||
38 | |||
39 | 8 | public function __construct(ContainerInterface $ci, Executor $executor) |
|
45 | |||
46 | |||
47 | /** |
||
48 | * @param Request $request |
||
49 | * @param Response $response |
||
50 | * @param array $args |
||
51 | * @return Response |
||
52 | */ |
||
53 | 8 | public function __invoke(Request $request, Response $response, array $args) |
|
69 | |||
70 | |||
71 | /** |
||
72 | * @param array|NULL $data |
||
73 | * @return array |
||
74 | */ |
||
75 | 6 | private function flatten($data) |
|
99 | |||
100 | |||
101 | /** |
||
102 | * @param string $projectName |
||
103 | * @param string $action |
||
104 | * @return bool |
||
105 | */ |
||
106 | 7 | private function isHandled($projectName, $action) |
|
110 | |||
111 | |||
112 | /** |
||
113 | * @param array $actual |
||
114 | * @param array $flattened |
||
115 | * @param array $toProcess |
||
116 | * @return array |
||
117 | */ |
||
118 | 4 | private function flattenProcessArray(array $actual, array &$flattened, array &$toProcess) |
|
136 | |||
137 | |||
138 | /** |
||
139 | * @param Request $request |
||
140 | * @param string $projectName |
||
141 | * @param string $action |
||
142 | * @return Response |
||
143 | */ |
||
144 | 6 | private function handle(Request $request, Response $response, $projectName, $action) |
|
167 | |||
168 | } |
||
169 |