webshelf /
framework
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * Return the auth account instance class. |
||
| 5 | * |
||
| 6 | * @return \App\Model\Account|\Illuminate\Contracts\Auth\Authenticatable |
||
| 7 | */ |
||
| 8 | function account() |
||
| 9 | { |
||
| 10 | return auth()->user(); |
||
| 11 | } |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Return the webshelf framework version. |
||
| 15 | * |
||
| 16 | * @return App\Framework |
||
| 17 | */ |
||
| 18 | function framework() |
||
| 19 | { |
||
| 20 | return app(App\Framework::class); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return \App\Classes\SettingsManager |
||
| 25 | */ |
||
| 26 | function settings() |
||
| 27 | { |
||
| 28 | return app(\App\Classes\SettingsManager::class); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return \App\Classes\PluginManager |
||
| 33 | */ |
||
| 34 | function plugins() |
||
| 35 | { |
||
| 36 | return app(\App\Classes\PluginManager::class); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return \App\Classes\Library\StyleCSS\Style |
||
| 41 | */ |
||
| 42 | function css() |
||
| 43 | { |
||
| 44 | return app(\App\Classes\Library\StyleCSS\Style::class); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Returned the morphed model. |
||
| 49 | * |
||
| 50 | * @param string $table |
||
| 51 | * @param int $id |
||
| 52 | * @return App\Classes\Interfaces\Linkable |
||
| 53 | */ |
||
| 54 | function getMorphedModel(string $table, int $id) |
||
| 55 | { |
||
| 56 | return app($table)->whereKey($id)->first(); |
||
|
0 ignored issues
–
show
|
|||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | function currentURI() |
||
| 63 | { |
||
| 64 | $route = basename(request()->path()) ?: 'index'; |
||
| 65 | |||
| 66 | return $route != '' ? $route : 'index'; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Return an array of the segmented url path. |
||
| 71 | * |
||
| 72 | * @return array |
||
| 73 | */ |
||
| 74 | function segmentRequestPath() |
||
| 75 | { |
||
| 76 | $path = app('request')->path(); |
||
| 77 | |||
| 78 | if ($path == '/') { |
||
| 79 | return ['index']; |
||
| 80 | } |
||
| 81 | |||
| 82 | return explode('/', $path); |
||
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * Turn a boolean value into readable data. |
||
| 87 | * true = Active |
||
| 88 | * false = Inactive. |
||
| 89 | * |
||
| 90 | * @param $boolean |
||
| 91 | * @param null $trueMessage |
||
|
0 ignored issues
–
show
|
|||
| 92 | * @param null $falseMessage |
||
| 93 | * @return string |
||
| 94 | * @internal param null $true |
||
| 95 | * @internal param null $false |
||
| 96 | * @deprecated |
||
| 97 | */ |
||
| 98 | function bool2Status($boolean, $trueMessage = null, $falseMessage = null) |
||
| 99 | { |
||
| 100 | if ($boolean == true) { |
||
| 101 | return '<span class="status green">'.($trueMessage ?: 'Active').'</span>'; |
||
| 102 | } else { |
||
| 103 | return '<span class="status red">'.($falseMessage ?: 'Inactive').'</span>'; |
||
| 104 | } |
||
| 105 | } |
||
| 106 |
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.