mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 15:44:45 +02:00
Basic fixes from phpstan
This commit is contained in:
parent
6b5e990a1c
commit
095bc89aee
@ -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,
|
||||
|
@ -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'));
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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',
|
||||
];
|
||||
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
@ -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]);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class ServerVariableTransformer extends BaseTransformer
|
||||
*/
|
||||
public function getResourceName(): string
|
||||
{
|
||||
return ServerVariable::RESOURCE_NAME;
|
||||
return EggVariable::RESOURCE_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user