diff --git a/app/Console/Commands/RegisterApp.php b/app/Console/Commands/RegisterApp.php index c10a7a35..cff18228 100644 --- a/app/Console/Commands/RegisterApp.php +++ b/app/Console/Commands/RegisterApp.php @@ -59,7 +59,7 @@ class RegisterApp extends Command * @param bool $remove * @return void */ - public function addApp($folder, bool $remove = false) + public function addApp($folder, bool $remove = false): void { $json = app_path('SupportedApps/'.$folder.'/app.json'); @@ -98,7 +98,7 @@ class RegisterApp extends Command * @param $icon * @return void */ - private function saveIcon($appFolder, $icon) + private function saveIcon($appFolder, $icon): void { $iconPath = app_path('SupportedApps/' . $appFolder . '/' . $icon); $contents = file_get_contents($iconPath); diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 02f4dcc4..dcf6d59c 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -135,7 +135,7 @@ class LoginController extends Controller * * @return Application|Factory|View */ - public function showLoginForm() + public function showLoginForm(): \Illuminate\View\View { return view('auth.login'); } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 8d8d3053..3c4fd440 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -60,7 +60,7 @@ class RegisterController extends Controller * @param array $data * @return User */ - protected function create(array $data) + protected function create(array $data): User { return User::create([ 'name' => $data['name'], diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index 77f7baa4..84d4d3f9 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -511,7 +511,7 @@ class ItemController extends Controller /** * @return \Illuminate\Contracts\Foundation\Application|RedirectResponse|Redirector */ - public function checkAppList() + public function checkAppList(): RedirectResponse { ProcessApps::dispatch(); $route = route('items.index'); diff --git a/app/Http/Controllers/ItemRestController.php b/app/Http/Controllers/ItemRestController.php index d147d8a8..ff908e4a 100644 --- a/app/Http/Controllers/ItemRestController.php +++ b/app/Http/Controllers/ItemRestController.php @@ -20,7 +20,7 @@ class ItemRestController extends Controller * * @return Collection */ - public function index() + public function index(): Collection { $columns = [ 'title', @@ -70,7 +70,7 @@ class ItemRestController extends Controller * @param Item $item * @return Response */ - public function show(Item $item) + public function show(Item $item): Response { // } @@ -81,7 +81,7 @@ class ItemRestController extends Controller * @param Item $item * @return Response */ - public function edit(Item $item) + public function edit(Item $item): Response { // } @@ -93,7 +93,7 @@ class ItemRestController extends Controller * @param Item $item * @return Response */ - public function update(Request $request, Item $item) + public function update(Request $request, Item $item): Response { // } @@ -104,7 +104,7 @@ class ItemRestController extends Controller * @param Item $item * @return Response */ - public function destroy(Item $item) + public function destroy(Item $item): Response { // } diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 1b65a824..4460bce4 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -22,7 +22,7 @@ class TagController extends Controller * * @return Application|Factory|View */ - public function index(Request $request) + public function index(Request $request): \Illuminate\View\View { $trash = (bool) $request->input('trash'); @@ -40,7 +40,7 @@ class TagController extends Controller * * @return Application|Factory|View */ - public function create() + public function create(): \Illuminate\View\View { $data = []; diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 256cd0d8..b426878b 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -41,7 +41,7 @@ class UserController extends Controller return view('users.create', $data); } - public function selectUser() + public function selectUser(): \Illuminate\View\View { Auth::logout(); $data['users'] = User::all(); diff --git a/app/Item.php b/app/Item.php index 76a8be7c..e89943a2 100644 --- a/app/Item.php +++ b/app/Item.php @@ -79,7 +79,7 @@ class Item extends Model /** * @return void */ - protected static function boot() + protected static function boot(): void { parent::boot(); diff --git a/app/Jobs/UpdateApps.php b/app/Jobs/UpdateApps.php index e034ae81..77b6eb9d 100644 --- a/app/Jobs/UpdateApps.php +++ b/app/Jobs/UpdateApps.php @@ -53,7 +53,7 @@ class UpdateApps implements ShouldQueue, ShouldBeUnique /** * @return void */ - public function failed($exception) + public function failed($exception): void { Cache::lock('updateApps')->forceRelease(); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ed917bbc..21bfa6f1 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -108,7 +108,7 @@ class AppServiceProvider extends ServiceProvider * * @return void */ - public function genKey() + public function genKey(): void { if (is_file(base_path('.env'))) { if (empty(env('APP_KEY'))) { @@ -188,7 +188,7 @@ class AppServiceProvider extends ServiceProvider /** * @return void */ - private function updateApps() + private function updateApps(): void { // This lock ensures that the job is not invoked multiple times. // In 5 minutes all app updates should be finished. diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 8c99db06..76c28314 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -32,7 +32,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - public function map() + public function map(): void { $this->mapApiRoutes(); @@ -48,7 +48,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - protected function mapWebRoutes() + protected function mapWebRoutes(): void { Route::middleware('web') ->group(base_path('routes/web.php')); @@ -61,7 +61,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - protected function mapApiRoutes() + protected function mapApiRoutes(): void { Route::prefix('api') ->middleware('api') diff --git a/app/Setting.php b/app/Setting.php index be1adbb4..243a1adf 100644 --- a/app/Setting.php +++ b/app/Setting.php @@ -224,7 +224,7 @@ class Setting extends Model * * @return mixed */ - public static function _fetch($key, $user = null) + public static function _fetch(string $key, $user = null) { // @codingStandardsIgnoreEnd //$cachekey = ($user === null) ? $key : $key.'-'.$user->id; @@ -270,7 +270,7 @@ class Setting extends Model * @param string $key * @param $value */ - public static function add($key, $value) + public static function add(string $key, $value) { self::$cache[$key] = $value; } @@ -280,7 +280,7 @@ class Setting extends Model * * @return bool */ - public static function cached($key): bool + public static function cached(string $key): bool { return array_key_exists($key, self::$cache); } diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index bc3533a3..f5f88257 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -32,7 +32,7 @@ class UserFactory extends Factory * * @return \Illuminate\Database\Eloquent\Factories\Factory */ - public function unverified() + public function unverified(): Factory { return $this->state(function (array $attributes) { return [