mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-29 19:50:03 +09:00
Add type hints from DocBlocks
This commit is contained in:
@@ -59,7 +59,7 @@ class RegisterApp extends Command
|
|||||||
* @param bool $remove
|
* @param bool $remove
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addApp($folder, bool $remove = false)
|
public function addApp($folder, bool $remove = false): void
|
||||||
{
|
{
|
||||||
$json = app_path('SupportedApps/'.$folder.'/app.json');
|
$json = app_path('SupportedApps/'.$folder.'/app.json');
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ class RegisterApp extends Command
|
|||||||
* @param $icon
|
* @param $icon
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function saveIcon($appFolder, $icon)
|
private function saveIcon($appFolder, $icon): void
|
||||||
{
|
{
|
||||||
$iconPath = app_path('SupportedApps/' . $appFolder . '/' . $icon);
|
$iconPath = app_path('SupportedApps/' . $appFolder . '/' . $icon);
|
||||||
$contents = file_get_contents($iconPath);
|
$contents = file_get_contents($iconPath);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class LoginController extends Controller
|
|||||||
*
|
*
|
||||||
* @return Application|Factory|View
|
* @return Application|Factory|View
|
||||||
*/
|
*/
|
||||||
public function showLoginForm()
|
public function showLoginForm(): \Illuminate\View\View
|
||||||
{
|
{
|
||||||
return view('auth.login');
|
return view('auth.login');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class RegisterController extends Controller
|
|||||||
* @param array $data
|
* @param array $data
|
||||||
* @return User
|
* @return User
|
||||||
*/
|
*/
|
||||||
protected function create(array $data)
|
protected function create(array $data): User
|
||||||
{
|
{
|
||||||
return User::create([
|
return User::create([
|
||||||
'name' => $data['name'],
|
'name' => $data['name'],
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ class ItemController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @return \Illuminate\Contracts\Foundation\Application|RedirectResponse|Redirector
|
* @return \Illuminate\Contracts\Foundation\Application|RedirectResponse|Redirector
|
||||||
*/
|
*/
|
||||||
public function checkAppList()
|
public function checkAppList(): RedirectResponse
|
||||||
{
|
{
|
||||||
ProcessApps::dispatch();
|
ProcessApps::dispatch();
|
||||||
$route = route('items.index');
|
$route = route('items.index');
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class ItemRestController extends Controller
|
|||||||
*
|
*
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(): Collection
|
||||||
{
|
{
|
||||||
$columns = [
|
$columns = [
|
||||||
'title',
|
'title',
|
||||||
@@ -70,7 +70,7 @@ class ItemRestController extends Controller
|
|||||||
* @param Item $item
|
* @param Item $item
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function show(Item $item)
|
public function show(Item $item): Response
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ class ItemRestController extends Controller
|
|||||||
* @param Item $item
|
* @param Item $item
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function edit(Item $item)
|
public function edit(Item $item): Response
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ class ItemRestController extends Controller
|
|||||||
* @param Item $item
|
* @param Item $item
|
||||||
* @return Response
|
* @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
|
* @param Item $item
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function destroy(Item $item)
|
public function destroy(Item $item): Response
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class TagController extends Controller
|
|||||||
*
|
*
|
||||||
* @return Application|Factory|View
|
* @return Application|Factory|View
|
||||||
*/
|
*/
|
||||||
public function index(Request $request)
|
public function index(Request $request): \Illuminate\View\View
|
||||||
{
|
{
|
||||||
$trash = (bool) $request->input('trash');
|
$trash = (bool) $request->input('trash');
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ class TagController extends Controller
|
|||||||
*
|
*
|
||||||
* @return Application|Factory|View
|
* @return Application|Factory|View
|
||||||
*/
|
*/
|
||||||
public function create()
|
public function create(): \Illuminate\View\View
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class UserController extends Controller
|
|||||||
return view('users.create', $data);
|
return view('users.create', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function selectUser()
|
public function selectUser(): \Illuminate\View\View
|
||||||
{
|
{
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
$data['users'] = User::all();
|
$data['users'] = User::all();
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class Item extends Model
|
|||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected static function boot()
|
protected static function boot(): void
|
||||||
{
|
{
|
||||||
parent::boot();
|
parent::boot();
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class UpdateApps implements ShouldQueue, ShouldBeUnique
|
|||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function failed($exception)
|
public function failed($exception): void
|
||||||
{
|
{
|
||||||
Cache::lock('updateApps')->forceRelease();
|
Cache::lock('updateApps')->forceRelease();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function genKey()
|
public function genKey(): void
|
||||||
{
|
{
|
||||||
if (is_file(base_path('.env'))) {
|
if (is_file(base_path('.env'))) {
|
||||||
if (empty(env('APP_KEY'))) {
|
if (empty(env('APP_KEY'))) {
|
||||||
@@ -188,7 +188,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function updateApps()
|
private function updateApps(): void
|
||||||
{
|
{
|
||||||
// This lock ensures that the job is not invoked multiple times.
|
// This lock ensures that the job is not invoked multiple times.
|
||||||
// In 5 minutes all app updates should be finished.
|
// In 5 minutes all app updates should be finished.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function map()
|
public function map(): void
|
||||||
{
|
{
|
||||||
$this->mapApiRoutes();
|
$this->mapApiRoutes();
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function mapWebRoutes()
|
protected function mapWebRoutes(): void
|
||||||
{
|
{
|
||||||
Route::middleware('web')
|
Route::middleware('web')
|
||||||
->group(base_path('routes/web.php'));
|
->group(base_path('routes/web.php'));
|
||||||
@@ -61,7 +61,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function mapApiRoutes()
|
protected function mapApiRoutes(): void
|
||||||
{
|
{
|
||||||
Route::prefix('api')
|
Route::prefix('api')
|
||||||
->middleware('api')
|
->middleware('api')
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ class Setting extends Model
|
|||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public static function _fetch($key, $user = null)
|
public static function _fetch(string $key, $user = null)
|
||||||
{
|
{
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
||||||
//$cachekey = ($user === null) ? $key : $key.'-'.$user->id;
|
//$cachekey = ($user === null) ? $key : $key.'-'.$user->id;
|
||||||
@@ -270,7 +270,7 @@ class Setting extends Model
|
|||||||
* @param string $key
|
* @param string $key
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public static function add($key, $value)
|
public static function add(string $key, $value)
|
||||||
{
|
{
|
||||||
self::$cache[$key] = $value;
|
self::$cache[$key] = $value;
|
||||||
}
|
}
|
||||||
@@ -280,7 +280,7 @@ class Setting extends Model
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function cached($key): bool
|
public static function cached(string $key): bool
|
||||||
{
|
{
|
||||||
return array_key_exists($key, self::$cache);
|
return array_key_exists($key, self::$cache);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class UserFactory extends Factory
|
|||||||
*
|
*
|
||||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||||
*/
|
*/
|
||||||
public function unverified()
|
public function unverified(): Factory
|
||||||
{
|
{
|
||||||
return $this->state(function (array $attributes) {
|
return $this->state(function (array $attributes) {
|
||||||
return [
|
return [
|
||||||
|
|||||||
Reference in New Issue
Block a user