| @@ 242-260 (lines=19) @@ | ||
| 239 | { |
|
| 240 | if (!empty($data['path']) && $uri === $data['path']) { |
|
| 241 | ||
| 242 | if ($this->requestType === 'default' && in_array($this->request->getMethod(), $data['method'])) { |
|
| 243 | ||
| 244 | return [ |
|
| 245 | $data['controller'], |
|
| 246 | $data['action'] . 'Action', |
|
| 247 | $data['permission'] ?? null, |
|
| 248 | [] |
|
| 249 | ]; |
|
| 250 | ||
| 251 | } else if ($this->requestType === 'api') { |
|
| 252 | ||
| 253 | return [ |
|
| 254 | $data['controller'], |
|
| 255 | $this->getRestfulAction(), |
|
| 256 | $data['permission'] ?? null, |
|
| 257 | [] |
|
| 258 | ]; |
|
| 259 | ||
| 260 | } |
|
| 261 | ||
| 262 | throw new MethodNotFoundException('Non valid request method available.'); |
|
| 263 | ||
| @@ 340-358 (lines=19) @@ | ||
| 337 | ||
| 338 | array_splice($var, 0, 1); |
|
| 339 | ||
| 340 | if ($this->requestType === 'default' && in_array($this->request->getMethod(), $data['method'])) { |
|
| 341 | ||
| 342 | return [ |
|
| 343 | $data['controller'], |
|
| 344 | $data['action'] . 'Action', |
|
| 345 | $data['permission'] ?? null, |
|
| 346 | $var |
|
| 347 | ]; |
|
| 348 | ||
| 349 | } else if ($this->requestType === 'api') { |
|
| 350 | ||
| 351 | return [ |
|
| 352 | $data['controller'], |
|
| 353 | $this->getRestfulAction(), |
|
| 354 | $data['permission'] ?? null, |
|
| 355 | $var |
|
| 356 | ]; |
|
| 357 | ||
| 358 | } |
|
| 359 | ||
| 360 | } |
|
| 361 | ||