mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-01 05:27:45 +09:00
Remove redundant typing from DocBlocks
This commit is contained in:
@@ -66,17 +66,11 @@ class Application extends Model
|
||||
return $this->icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function iconView(): string
|
||||
{
|
||||
return asset('storage/'.$this->icon);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function defaultColour(): string
|
||||
{
|
||||
// check if light or dark
|
||||
@@ -87,9 +81,6 @@ class Application extends Model
|
||||
return '#161b1f';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function class(): string
|
||||
{
|
||||
$name = $this->name;
|
||||
@@ -100,7 +91,6 @@ class Application extends Model
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @return string
|
||||
*/
|
||||
public static function classFromName($name): string
|
||||
{
|
||||
@@ -111,9 +101,6 @@ class Application extends Model
|
||||
return $class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public static function apps(): Collection
|
||||
{
|
||||
$json = json_decode(file_get_contents(storage_path('app/supportedapps.json'))) ?? [];
|
||||
@@ -122,9 +109,6 @@ class Application extends Model
|
||||
return $apps->sortBy('name', SORT_NATURAL | SORT_FLAG_CASE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function autocomplete(): array
|
||||
{
|
||||
$apps = self::apps();
|
||||
@@ -193,9 +177,6 @@ class Application extends Model
|
||||
return $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function applist(): array
|
||||
{
|
||||
$list = [];
|
||||
|
||||
@@ -35,8 +35,6 @@ class RegisterApp extends Command
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
@@ -56,8 +54,6 @@ class RegisterApp extends Command
|
||||
|
||||
/**
|
||||
* @param $folder
|
||||
* @param bool $remove
|
||||
* @return void
|
||||
*/
|
||||
public function addApp($folder, bool $remove = false): void
|
||||
{
|
||||
@@ -96,7 +92,6 @@ class RegisterApp extends Command
|
||||
/**
|
||||
* @param $appFolder
|
||||
* @param $icon
|
||||
* @return void
|
||||
*/
|
||||
private function saveIcon($appFolder, $icon): void
|
||||
{
|
||||
|
||||
@@ -9,9 +9,6 @@ class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
@@ -21,8 +18,6 @@ class Kernel extends ConsoleKernel
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands(): void
|
||||
{
|
||||
|
||||
@@ -49,9 +49,6 @@ class LoginController extends Controller
|
||||
$this->middleware('guest')->except(['logout','autologin']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function username(): string
|
||||
{
|
||||
return 'username';
|
||||
@@ -60,8 +57,6 @@ class LoginController extends Controller
|
||||
/**
|
||||
* Handle a login request to the application.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*
|
||||
* @throws ValidationException
|
||||
*/
|
||||
@@ -97,10 +92,6 @@ class LoginController extends Controller
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function setUser(User $user): RedirectResponse
|
||||
{
|
||||
Auth::logout();
|
||||
@@ -111,7 +102,6 @@ class LoginController extends Controller
|
||||
|
||||
/**
|
||||
* @param $uuid
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function autologin($uuid): RedirectResponse
|
||||
{
|
||||
@@ -141,9 +131,7 @@ class LoginController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param $user
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
protected function authenticated(Request $request, $user): RedirectResponse
|
||||
{
|
||||
|
||||
@@ -41,9 +41,6 @@ class RegisterController extends Controller
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data): \Illuminate\Contracts\Validation\Validator
|
||||
{
|
||||
@@ -56,9 +53,6 @@ class RegisterController extends Controller
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return User
|
||||
*/
|
||||
protected function create(array $data): User
|
||||
{
|
||||
|
||||
@@ -12,17 +12,11 @@ use Illuminate\Support\Facades\RateLimiter;
|
||||
|
||||
class HealthController extends Controller
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
private static function getUsers(): int
|
||||
{
|
||||
return User::count();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
private static function getItems(): int
|
||||
{
|
||||
return Item::select('id')
|
||||
@@ -34,7 +28,6 @@ class HealthController extends Controller
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return JsonResponse|Response
|
||||
* @throws BindingResolutionException
|
||||
*/
|
||||
|
||||
@@ -19,8 +19,6 @@ class HomeController extends Controller
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function index(): RedirectResponse
|
||||
{
|
||||
|
||||
@@ -20,9 +20,6 @@ class ImportController extends Controller
|
||||
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return View
|
||||
*/
|
||||
public function __invoke(Request $request): View
|
||||
{
|
||||
|
||||
@@ -32,8 +32,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Display a listing of the resource on the dashboard.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function dash(): View
|
||||
{
|
||||
@@ -69,7 +67,6 @@ class ItemController extends Controller
|
||||
* Pin item on the dashboard.
|
||||
*
|
||||
* @param $id
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function pin($id): RedirectResponse
|
||||
{
|
||||
@@ -85,7 +82,6 @@ class ItemController extends Controller
|
||||
* Unpin item on the dashboard.
|
||||
*
|
||||
* @param $id
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function unpin($id): RedirectResponse
|
||||
{
|
||||
@@ -135,9 +131,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return View
|
||||
*/
|
||||
public function index(Request $request): View
|
||||
{
|
||||
@@ -154,8 +147,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
@@ -169,9 +160,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return View
|
||||
*/
|
||||
public function edit(int $id): View
|
||||
{
|
||||
@@ -194,9 +182,7 @@ class ItemController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param null $id
|
||||
* @return Item
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public static function storelogic(Request $request, $id = null): Item
|
||||
@@ -287,9 +273,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
@@ -303,9 +286,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return void
|
||||
*/
|
||||
public function show(int $id): void
|
||||
{
|
||||
@@ -314,10 +294,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function update(Request $request, int $id): RedirectResponse
|
||||
{
|
||||
@@ -330,10 +306,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function destroy(Request $request, int $id): RedirectResponse
|
||||
{
|
||||
@@ -355,9 +327,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* Restore the specified resource from soft deletion.
|
||||
*
|
||||
* @param int $id
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function restore(int $id): RedirectResponse
|
||||
{
|
||||
@@ -375,8 +344,6 @@ class ItemController extends Controller
|
||||
/**
|
||||
* Return details for supported apps
|
||||
*
|
||||
* @param Request $request
|
||||
* @return string|null
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function appload(Request $request): ?string
|
||||
@@ -419,7 +386,6 @@ class ItemController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return void
|
||||
*/
|
||||
public function testConfig(Request $request)
|
||||
@@ -448,9 +414,7 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* @param $url
|
||||
* @param array $attrs
|
||||
* @param array|bool $overridevars
|
||||
* @return ResponseInterface|null
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function execute($url, array $attrs = [], $overridevars = false): ?ResponseInterface
|
||||
@@ -481,7 +445,6 @@ class ItemController extends Controller
|
||||
|
||||
/**
|
||||
* @param $url
|
||||
* @return StreamInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function websitelookup($url): StreamInterface
|
||||
|
||||
@@ -17,8 +17,6 @@ class ItemRestController extends Controller
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function index(): Collection
|
||||
{
|
||||
@@ -49,9 +47,6 @@ class ItemRestController extends Controller
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return object
|
||||
*/
|
||||
public function store(Request $request): object
|
||||
{
|
||||
@@ -66,9 +61,6 @@ class ItemRestController extends Controller
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param Item $item
|
||||
* @return Response
|
||||
*/
|
||||
public function show(Item $item): Response
|
||||
{
|
||||
@@ -77,9 +69,6 @@ class ItemRestController extends Controller
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param Item $item
|
||||
* @return Response
|
||||
*/
|
||||
public function edit(Item $item): Response
|
||||
{
|
||||
@@ -88,10 +77,6 @@ class ItemRestController extends Controller
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Item $item
|
||||
* @return Response
|
||||
*/
|
||||
public function update(Request $request, Item $item): Response
|
||||
{
|
||||
@@ -100,9 +85,6 @@ class ItemRestController extends Controller
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param Item $item
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy(Item $item): Response
|
||||
{
|
||||
|
||||
@@ -11,7 +11,6 @@ use Illuminate\Routing\Redirector;
|
||||
class SearchController extends Controller
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return Application|RedirectResponse|Redirector|mixed|void
|
||||
*/
|
||||
public function index(Request $request)
|
||||
|
||||
@@ -17,9 +17,6 @@ class SettingsController extends Controller
|
||||
$this->middleware('allowed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return View
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
$settings = SettingGroup::with([
|
||||
@@ -32,7 +29,6 @@ class SettingsController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return RedirectResponse|View
|
||||
*/
|
||||
@@ -59,12 +55,6 @@ class SettingsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function update(Request $request, int $id): RedirectResponse
|
||||
{
|
||||
$setting = Setting::find($id);
|
||||
@@ -114,11 +104,6 @@ class SettingsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function clear(int $id): RedirectResponse
|
||||
{
|
||||
$user = $this->user();
|
||||
|
||||
@@ -49,9 +49,6 @@ class TagController extends Controller
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
@@ -90,7 +87,6 @@ class TagController extends Controller
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param $slug
|
||||
* @return View
|
||||
*/
|
||||
public function show($slug): View
|
||||
{
|
||||
@@ -105,9 +101,6 @@ class TagController extends Controller
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return View
|
||||
*/
|
||||
public function edit(int $id): View
|
||||
{
|
||||
@@ -121,10 +114,6 @@ class TagController extends Controller
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function update(Request $request, int $id): RedirectResponse
|
||||
{
|
||||
@@ -156,10 +145,6 @@ class TagController extends Controller
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function destroy(Request $request, int $id): RedirectResponse
|
||||
{
|
||||
@@ -181,9 +166,6 @@ class TagController extends Controller
|
||||
|
||||
/**
|
||||
* Restore the specified resource from soft deletion.
|
||||
*
|
||||
* @param int $id
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function restore(int $id): RedirectResponse
|
||||
{
|
||||
|
||||
@@ -19,8 +19,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
@@ -31,8 +29,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
@@ -51,9 +47,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
@@ -93,9 +86,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return void
|
||||
*/
|
||||
public function show(int $id): void
|
||||
{
|
||||
@@ -104,9 +94,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param User $user
|
||||
* @return View
|
||||
*/
|
||||
public function edit(User $user): View
|
||||
{
|
||||
@@ -117,10 +104,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param User $user
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function update(Request $request, User $user): RedirectResponse
|
||||
{
|
||||
@@ -166,7 +149,6 @@ class UserController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param User $user
|
||||
* @return RedirectResponse | void
|
||||
*/
|
||||
public function destroy(User $user): RedirectResponse
|
||||
|
||||
@@ -16,9 +16,6 @@ class CheckAllowed
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Closure $next
|
||||
* @return mixed
|
||||
* @throws AuthenticationException
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
|
||||
@@ -11,11 +11,6 @@ class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Closure $next
|
||||
* @param string|null $guard
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, string $guard = null): Response
|
||||
{
|
||||
|
||||
38
app/Item.php
38
app/Item.php
@@ -76,9 +76,6 @@ class Item extends Model
|
||||
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected static function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
@@ -113,9 +110,6 @@ class Item extends Model
|
||||
|
||||
/**
|
||||
* Scope a query to only include pinned items.
|
||||
*
|
||||
* @param Builder $query
|
||||
* @return Builder
|
||||
*/
|
||||
public function scopePinned(Builder $query): Builder
|
||||
{
|
||||
@@ -153,9 +147,6 @@ class Item extends Model
|
||||
return $tagdetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTagClass(): string
|
||||
{
|
||||
$tags = $this->tags();
|
||||
@@ -170,17 +161,11 @@ class Item extends Model
|
||||
return implode(' ', $slugs);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsToMany
|
||||
*/
|
||||
public function parents(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Item::class, 'item_tag', 'item_id', 'tag_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsToMany
|
||||
*/
|
||||
public function children(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Item::class, 'item_tag', 'tag_id', 'item_id');
|
||||
@@ -198,9 +183,6 @@ class Item extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDroppableAttribute(): string
|
||||
{
|
||||
if ((int) $this->type === 1) {
|
||||
@@ -210,9 +192,6 @@ class Item extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLinkTargetAttribute(): string
|
||||
{
|
||||
$target = Setting::fetch('window_target');
|
||||
@@ -224,9 +203,6 @@ class Item extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLinkIconAttribute(): string
|
||||
{
|
||||
if ((int) $this->type === 1) {
|
||||
@@ -236,9 +212,6 @@ class Item extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLinkTypeAttribute(): string
|
||||
{
|
||||
if ((int) $this->type === 1) {
|
||||
@@ -279,9 +252,6 @@ class Item extends Model
|
||||
return $query->where('type', $typeid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function enhanced(): bool
|
||||
{
|
||||
/*if(isset($this->class) && !empty($this->class)) {
|
||||
@@ -295,7 +265,6 @@ class Item extends Model
|
||||
|
||||
/**
|
||||
* @param $class
|
||||
* @return bool
|
||||
*/
|
||||
public static function isEnhanced($class): bool
|
||||
{
|
||||
@@ -321,9 +290,6 @@ class Item extends Model
|
||||
return ((bool) ($app instanceof SearchInterface)) ? $app : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function enabled(): bool
|
||||
{
|
||||
if ($this->enhanced()) {
|
||||
@@ -369,7 +335,6 @@ class Item extends Model
|
||||
|
||||
/**
|
||||
* @param $class
|
||||
* @return Application|null
|
||||
*/
|
||||
public static function applicationDetails($class): ?Application
|
||||
{
|
||||
@@ -386,7 +351,6 @@ class Item extends Model
|
||||
|
||||
/**
|
||||
* @param $class
|
||||
* @return string
|
||||
*/
|
||||
public static function getApplicationDescription($class): string
|
||||
{
|
||||
@@ -400,8 +364,6 @@ class Item extends Model
|
||||
|
||||
/**
|
||||
* Get the user that owns the item.
|
||||
*
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -32,7 +32,6 @@ class ProcessApps implements ShouldQueue, ShouldBeUnique
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function handle(): void
|
||||
|
||||
@@ -30,7 +30,6 @@ class UpdateApps implements ShouldQueue, ShouldBeUnique
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function handle(): void
|
||||
@@ -50,9 +49,6 @@ class UpdateApps implements ShouldQueue, ShouldBeUnique
|
||||
Cache::lock('updateApps')->forceRelease();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function failed($exception): void
|
||||
{
|
||||
Cache::lock('updateApps')->forceRelease();
|
||||
|
||||
@@ -19,8 +19,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
@@ -105,8 +103,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Generate app key if missing and .env exists
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function genKey(): void
|
||||
{
|
||||
@@ -119,8 +115,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
@@ -136,7 +130,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Check if database needs an update or do first time database setup
|
||||
*
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
@@ -158,9 +151,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function createEnvFile(): void
|
||||
{
|
||||
if (!is_file(base_path('.env'))) {
|
||||
@@ -170,9 +160,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
$this->genKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
private function needsDBUpdate(): bool
|
||||
{
|
||||
if (!Schema::hasTable('settings')) {
|
||||
@@ -185,9 +172,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
return version_compare($app_version, $db_version) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function updateApps(): void
|
||||
{
|
||||
// This lock ensures that the job is not invoked multiple times.
|
||||
|
||||
@@ -17,8 +17,6 @@ class AuthServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
|
||||
@@ -19,8 +19,6 @@ class EventServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
@@ -31,8 +29,6 @@ class EventServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Determine if events and listeners should be automatically discovered.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldDiscoverEvents(): bool
|
||||
{
|
||||
|
||||
@@ -17,8 +17,6 @@ class RouteServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
@@ -29,8 +27,6 @@ class RouteServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(): void
|
||||
{
|
||||
@@ -45,8 +41,6 @@ class RouteServiceProvider extends ServiceProvider
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
@@ -58,8 +52,6 @@ class RouteServiceProvider extends ServiceProvider
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
|
||||
@@ -70,10 +70,6 @@ class Setting extends Model
|
||||
*/
|
||||
protected static $cache = [];
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return object
|
||||
*/
|
||||
public static function getInput(Request $request): object
|
||||
{
|
||||
return (object) [
|
||||
@@ -198,16 +194,12 @@ class Setting extends Model
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function group(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\App\SettingGroup::class, 'group_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -220,7 +212,6 @@ class Setting extends Model
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
/**
|
||||
* @param string $key
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -267,7 +258,6 @@ class Setting extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param $value
|
||||
*/
|
||||
public static function add(string $key, $value)
|
||||
@@ -275,11 +265,6 @@ class Setting extends Model
|
||||
self::$cache[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function cached(string $key): bool
|
||||
{
|
||||
return array_key_exists($key, self::$cache);
|
||||
|
||||
@@ -37,9 +37,6 @@ class SettingGroup extends Model
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return HasMany
|
||||
*/
|
||||
public function settings(): HasMany
|
||||
{
|
||||
return $this->hasMany(\App\Setting::class, 'group_id');
|
||||
|
||||
@@ -9,8 +9,6 @@ class ItemFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ class ItemTagFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
||||
@@ -29,8 +29,6 @@ class UserFactory extends Factory
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
public function unverified(): Factory
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -29,8 +27,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -28,8 +26,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -22,8 +20,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -20,8 +18,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -25,8 +23,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -28,8 +26,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -22,8 +20,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -20,8 +18,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -25,8 +23,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -30,8 +28,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -20,8 +18,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -26,8 +24,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -25,8 +23,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -20,8 +18,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -20,8 +18,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -20,8 +18,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -18,8 +16,6 @@ return new class extends Migration
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
|
||||
@@ -52,8 +52,6 @@ class SettingsSeeder extends Seeder
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
|
||||
@@ -9,8 +9,6 @@ class UsersSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
|
||||
@@ -9,8 +9,6 @@ trait CreatesApplication
|
||||
{
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
* @return \Illuminate\Foundation\Application
|
||||
*/
|
||||
public function createApplication(): Application
|
||||
{
|
||||
|
||||
@@ -9,8 +9,6 @@ class SettingsSeederTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* All language keys are defined in all languages based on the en language file.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function test_returns_a_jsonmap_with_same_amount_of_items_as_language_directories_present(): void
|
||||
{
|
||||
|
||||
@@ -6,9 +6,6 @@ use Tests\TestCase;
|
||||
|
||||
class IsImageTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test_returns_true_when_file_is_image(): void
|
||||
{
|
||||
$file = file_get_contents(__DIR__ . '/fixtures/heimdall-icon-small.png');
|
||||
@@ -18,9 +15,6 @@ class IsImageTest extends TestCase
|
||||
$this->assertTrue($actual);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test_returns_false_when_file_extension_is_image_but_content_is_not(): void
|
||||
{
|
||||
$actual = isImage("<?php ?>", "png");
|
||||
@@ -28,9 +22,6 @@ class IsImageTest extends TestCase
|
||||
$this->assertFalse($actual);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test_returns_false_when_file_extension_is_not_image_but_content_is(): void
|
||||
{
|
||||
$file = file_get_contents(__DIR__ . '/fixtures/heimdall-icon-small.png');
|
||||
|
||||
@@ -6,9 +6,6 @@ use Tests\TestCase;
|
||||
|
||||
class SlugTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test_slug_returns_valid_tag_for_cn_characters_when_language_is_set_to_en_US(): void
|
||||
{
|
||||
$tag = str_slug('中文測試', '-', 'en_US');
|
||||
|
||||
@@ -8,8 +8,6 @@ class LangTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* All language keys are defined in all languages based on the en language file.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function test_all_language_keys_are_defined(): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user