From 507f128bf6c4153fd85508dc3feacde49b7f92b1 Mon Sep 17 00:00:00 2001 From: cp6 Date: Sat, 19 Aug 2023 23:46:18 +1000 Subject: [PATCH] Added return types --- app/Models/DiskSpeed.php | 2 +- app/Models/Domains.php | 6 +++--- app/Models/Home.php | 2 +- app/Models/IPs.php | 2 +- app/Models/Labels.php | 10 +++++----- app/Models/LabelsAssigned.php | 2 +- app/Models/Misc.php | 2 +- app/Models/NetworkSpeed.php | 2 +- app/Models/Reseller.php | 10 +++++----- app/Models/SeedBoxes.php | 8 ++++---- app/Models/Shared.php | 10 +++++----- app/Models/Yabs.php | 6 +++--- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/app/Models/DiskSpeed.php b/app/Models/DiskSpeed.php index 8d93e8a..1648bfc 100644 --- a/app/Models/DiskSpeed.php +++ b/app/Models/DiskSpeed.php @@ -17,7 +17,7 @@ class DiskSpeed extends Model protected $fillable = ['id', 'server_id', 'd_4k', 'd_4k_type', 'd_4k_as_mbps', 'd_64k', 'd_64k_type', 'd_64k_as_mbps', 'd_512k', 'd_512k_type', 'd_512k_as_mbps', 'd_1m', 'd_1m_type', 'd_1m_as_mbps']; - public function yabs() + public function yabs(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Yabs::class, 'id', 'id'); } diff --git a/app/Models/Domains.php b/app/Models/Domains.php index 59127eb..ccdf3a7 100644 --- a/app/Models/Domains.php +++ b/app/Models/Domains.php @@ -41,17 +41,17 @@ class Domains extends Model }); } - public function provider() + public function provider(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Providers::class, 'id', 'provider_id'); } - public function price() + public function price(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Pricing::class, 'service_id', 'id'); } - public function labels() + public function labels(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(LabelsAssigned::class, 'service_id', 'id'); } diff --git a/app/Models/Home.php b/app/Models/Home.php index ed63222..973e30b 100644 --- a/app/Models/Home.php +++ b/app/Models/Home.php @@ -13,7 +13,7 @@ class Home extends Model { use HasFactory; - public static function homePageCacheForget() + public static function homePageCacheForget(): void { Cache::forget('services_count');//Main page services_count cache Cache::forget('due_soon');//Main page due_soon cache diff --git a/app/Models/IPs.php b/app/Models/IPs.php index 5a44c1f..0652017 100644 --- a/app/Models/IPs.php +++ b/app/Models/IPs.php @@ -20,7 +20,7 @@ class IPs extends Model public $incrementing = false; - public static function deleteIPsAssignedTo($service_id) + public static function deleteIPsAssignedTo($service_id): void { DB::table('ips')->where('service_id', $service_id)->delete(); } diff --git a/app/Models/Labels.php b/app/Models/Labels.php index 52ea6b6..adddbbb 100644 --- a/app/Models/Labels.php +++ b/app/Models/Labels.php @@ -19,17 +19,17 @@ class Labels extends Model protected $fillable = ['id', 'label', 'server_id', 'server_id_2', 'domain_id', 'domain_id_2', 'shared_id', 'shared_id_2']; - public static function deleteLabelsAssignedTo($service_id) + public static function deleteLabelsAssignedTo($service_id): void { DB::table('labels_assigned')->where('service_id', $service_id)->delete(); } - public static function deleteLabelAssignedAs($label_id) + public static function deleteLabelAssignedAs($label_id): void { DB::table('labels_assigned')->where('label_id', $label_id)->delete(); } - public static function insertLabelsAssigned(array $labels_array, string $service_id) + public static function insertLabelsAssigned(array $labels_array, string $service_id): void { for ($i = 1; $i <= 4; $i++) { if (!is_null($labels_array[($i - 1)])) { @@ -38,14 +38,14 @@ class Labels extends Model } } - public static function labelsCount() + public static function labelsCount(): int { return Cache::remember('labels_count', now()->addMonth(1), function () { return Labels::count(); }); } - public function assigned() + public function assigned(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(LabelsAssigned::class, 'label_id', 'id'); } diff --git a/app/Models/LabelsAssigned.php b/app/Models/LabelsAssigned.php index 72d88d4..7d62767 100644 --- a/app/Models/LabelsAssigned.php +++ b/app/Models/LabelsAssigned.php @@ -17,7 +17,7 @@ class LabelsAssigned extends Model protected $keyType = 'string'; - public function label() + public function label(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Labels::class, 'id', 'label_id'); } diff --git a/app/Models/Misc.php b/app/Models/Misc.php index 2363152..bc969c6 100644 --- a/app/Models/Misc.php +++ b/app/Models/Misc.php @@ -52,7 +52,7 @@ class Misc extends Model }); } - public function price() + public function price(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Pricing::class, 'service_id', 'id'); } diff --git a/app/Models/NetworkSpeed.php b/app/Models/NetworkSpeed.php index 565d13b..fb467de 100644 --- a/app/Models/NetworkSpeed.php +++ b/app/Models/NetworkSpeed.php @@ -17,7 +17,7 @@ class NetworkSpeed extends Model protected $fillable = ['id', 'server_id', 'location', 'send', 'send_type', 'send_as_mbps', 'receive', 'receive_type', 'receive_as_mbps', 'created_at', 'updated_at']; - public function yabs() + public function yabs(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Yabs::class, 'id', 'id'); } diff --git a/app/Models/Reseller.php b/app/Models/Reseller.php index 54c9d47..498fc3b 100644 --- a/app/Models/Reseller.php +++ b/app/Models/Reseller.php @@ -53,27 +53,27 @@ class Reseller extends Model }); } - public function ips() + public function ips(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(IPs::class, 'service_id', 'id'); } - public function location() + public function location(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Locations::class, 'id', 'location_id'); } - public function provider() + public function provider(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Providers::class, 'id', 'provider_id'); } - public function price() + public function price(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Pricing::class, 'service_id', 'id'); } - public function labels() + public function labels(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(LabelsAssigned::class, 'service_id', 'id'); } diff --git a/app/Models/SeedBoxes.php b/app/Models/SeedBoxes.php index 7e1c0a7..bedd20c 100644 --- a/app/Models/SeedBoxes.php +++ b/app/Models/SeedBoxes.php @@ -53,22 +53,22 @@ class SeedBoxes extends Model }); } - public function location() + public function location(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Locations::class, 'id', 'location_id'); } - public function provider() + public function provider(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Providers::class, 'id', 'provider_id'); } - public function price() + public function price(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Pricing::class, 'service_id', 'id'); } - public function labels() + public function labels(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(LabelsAssigned::class, 'service_id', 'id'); } diff --git a/app/Models/Shared.php b/app/Models/Shared.php index f26e86b..de9dd2c 100644 --- a/app/Models/Shared.php +++ b/app/Models/Shared.php @@ -53,27 +53,27 @@ class Shared extends Model }); } - public function ips() + public function ips(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(IPs::class, 'service_id', 'id'); } - public function location() + public function location(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Locations::class, 'id', 'location_id'); } - public function provider() + public function provider(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Providers::class, 'id', 'provider_id'); } - public function price() + public function price(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Pricing::class, 'service_id', 'id'); } - public function labels() + public function labels(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(LabelsAssigned::class, 'service_id', 'id'); } diff --git a/app/Models/Yabs.php b/app/Models/Yabs.php index d4a8ad1..aad00b0 100644 --- a/app/Models/Yabs.php +++ b/app/Models/Yabs.php @@ -39,17 +39,17 @@ class Yabs extends Model }); } - public function server() + public function server(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Server::class, 'id', 'server_id'); } - public function disk_speed() + public function disk_speed(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(DiskSpeed::class, 'id', 'id'); } - public function network_speed() + public function network_speed(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(NetworkSpeed::class, 'id', 'id'); }