| Total Complexity | 10 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class GetCurrentX |
||
| 11 | { |
||
| 12 | public static function getCurrentId() : int |
||
| 13 | { |
||
| 14 | $id = session('current_row_id') ?: Request::segment(4); |
||
| 15 | |||
| 16 | return intval($id); |
||
| 17 | } |
||
| 18 | |||
| 19 | public static function getCurrentMethod() : string |
||
| 20 | { |
||
| 21 | return str_after(Route::currentRouteAction(), "@"); |
||
| 22 | } |
||
| 23 | |||
| 24 | public static function getCurrentModule() |
||
| 25 | { |
||
| 26 | $modulePath = self::getModulePath(); |
||
| 27 | return cache()->remember('crudbooster_modules_'.$modulePath, 2, function () use ($modulePath) { |
||
| 28 | $module = app('CbModulesRegistery')->getModule($modulePath); |
||
|
|
|||
| 29 | return $module?: ModulesRepo::getByPath($modulePath); |
||
| 30 | }); |
||
| 31 | } |
||
| 32 | |||
| 33 | public static function getCurrentDashboardId() |
||
| 34 | { |
||
| 35 | if (request('d') == null) { |
||
| 36 | return session('currentDashboardId'); |
||
| 37 | } |
||
| 38 | session([ |
||
| 39 | 'currentDashboardId' => request('d'), |
||
| 40 | 'currentMenuId' => 0, |
||
| 41 | ]); |
||
| 42 | return request('d'); |
||
| 43 | } |
||
| 44 | |||
| 45 | public static function getCurrentMenuId() |
||
| 46 | { |
||
| 47 | if (request('m') == null) { |
||
| 48 | return session('currentMenuId'); |
||
| 49 | } |
||
| 50 | session([ |
||
| 51 | 'currentMenuId' => request('m'), |
||
| 52 | 'currentDashboardId' => 0, |
||
| 53 | ]); |
||
| 54 | |||
| 55 | return request('m'); |
||
| 56 | } |
||
| 57 | |||
| 58 | private static function getModulePath() |
||
| 63 | } |
||
| 64 | } |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.