| Conditions | 4 |
| Paths | 4 |
| Total Lines | 26 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Distilleries\Expendable\Http\Controllers\Backend; |
||
| 22 | public function getSynchronize(Registrar $router) |
||
| 23 | { |
||
| 24 | |||
| 25 | $routes = $router->getRoutes(); |
||
| 26 | |||
| 27 | foreach ($routes->getRoutes() as $controller) |
||
| 28 | { |
||
| 29 | $actions = $controller->getAction(); |
||
| 30 | |||
| 31 | if (!empty($actions['controller'])) { |
||
| 32 | $service = $actions['controller']; |
||
| 33 | $serviceObject = $this->model->getByAction($service); |
||
|
|
|||
| 34 | |||
| 35 | if ($serviceObject->isEmpty()) |
||
| 36 | { |
||
| 37 | $model = new $this->model; |
||
| 38 | $model->action = $service; |
||
| 39 | $model->save(); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | |||
| 44 | } |
||
| 45 | |||
| 46 | return redirect()->back(); |
||
| 47 | } |
||
| 48 | } |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: