diff --git a/app/Console/Commands/Node/NodeListCommand.php b/app/Console/Commands/Node/NodeListCommand.php index 9cc8d7ab3..75f72f14f 100644 --- a/app/Console/Commands/Node/NodeListCommand.php +++ b/app/Console/Commands/Node/NodeListCommand.php @@ -11,7 +11,7 @@ class NodeListCommand extends Command public function handle(): int { - $nodes = Node::query()->with('location')->get()->map(function (Node $node) { + $nodes = Node::query()->get()->map(function (Node $node) { return [ 'id' => $node->id, 'uuid' => $node->uuid, diff --git a/app/Console/Commands/User/MakeUserCommand.php b/app/Console/Commands/User/MakeUserCommand.php index 67abd924c..f9450d53e 100644 --- a/app/Console/Commands/User/MakeUserCommand.php +++ b/app/Console/Commands/User/MakeUserCommand.php @@ -32,7 +32,9 @@ class MakeUserCommand extends Command try { DB::select('select 1 where 1'); } catch (Exception $exception) { - return $this->error($exception->getMessage()) ?? 0; + $this->error($exception->getMessage()); + + return 1; } $root_admin = $this->option('admin') ?? $this->confirm(trans('command/messages.user.ask_admin')); diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 1f1d5ec35..8af3848e0 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -233,7 +233,7 @@ class Handler extends ExceptionHandler */ public static function isReportable(\Exception $exception): bool { - return (new static(Container::getInstance()))->shouldReport($exception); + return (new self(Container::getInstance()))->shouldReport($exception); } /** diff --git a/app/Http/Controllers/Auth/LoginCheckpointController.php b/app/Http/Controllers/Auth/LoginCheckpointController.php index 06069d653..6c57b7201 100644 --- a/app/Http/Controllers/Auth/LoginCheckpointController.php +++ b/app/Http/Controllers/Auth/LoginCheckpointController.php @@ -79,7 +79,7 @@ class LoginCheckpointController extends AbstractLoginController } } - $this->sendFailedLoginResponse($request, $user, !empty($recoveryToken) ? 'The recovery token provided is not valid.' : null); + return $this->sendFailedLoginResponse($request, $user, !empty($recoveryToken) ? 'The recovery token provided is not valid.' : null); } /** diff --git a/app/Models/ApiKey.php b/app/Models/ApiKey.php index e6cf1f352..355bd633f 100644 --- a/app/Models/ApiKey.php +++ b/app/Models/ApiKey.php @@ -143,8 +143,6 @@ class ApiKey extends Model 'r_' . AdminAcl::RESOURCE_DATABASE_HOSTS => 'integer|min:0|max:3', 'r_' . AdminAcl::RESOURCE_SERVER_DATABASES => 'integer|min:0|max:3', 'r_' . AdminAcl::RESOURCE_EGGS => 'integer|min:0|max:3', - 'r_' . AdminAcl::RESOURCE_LOCATIONS => 'integer|min:0|max:3', - 'r_' . AdminAcl::RESOURCE_EGGS => 'integer|min:0|max:3', 'r_' . AdminAcl::RESOURCE_NODES => 'integer|min:0|max:3', 'r_' . AdminAcl::RESOURCE_SERVERS => 'integer|min:0|max:3', ]; diff --git a/app/Rules/Fqdn.php b/app/Rules/Fqdn.php index f43f81de8..e6b0d874f 100644 --- a/app/Rules/Fqdn.php +++ b/app/Rules/Fqdn.php @@ -73,7 +73,7 @@ class Fqdn implements DataAwareRule, Rule */ public static function make(string $schemeField = null): self { - return tap(new static(), function ($fqdn) use ($schemeField) { + return tap(new self(), function ($fqdn) use ($schemeField) { $fqdn->schemeField = $schemeField; }); } diff --git a/app/Services/Servers/BuildModificationService.php b/app/Services/Servers/BuildModificationService.php index 0f1c6ac3b..502ca7e9b 100644 --- a/app/Services/Servers/BuildModificationService.php +++ b/app/Services/Servers/BuildModificationService.php @@ -95,7 +95,7 @@ class BuildModificationService // Keep track of all the allocations we're just now adding so that we can use the first // one to reset the default allocation to. - $freshlyAllocated = $query->pluck('id')->first(); + $freshlyAllocated = $query->first()?->id; $query->update(['server_id' => $server->id, 'notes' => null]); } diff --git a/app/Transformers/Api/Application/ServerVariableTransformer.php b/app/Transformers/Api/Application/ServerVariableTransformer.php index 1446f67a2..555fed228 100644 --- a/app/Transformers/Api/Application/ServerVariableTransformer.php +++ b/app/Transformers/Api/Application/ServerVariableTransformer.php @@ -19,7 +19,7 @@ class ServerVariableTransformer extends BaseTransformer */ public function getResourceName(): string { - return ServerVariable::RESOURCE_NAME; + return EggVariable::RESOURCE_NAME; } /**