mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 22:14:45 +02:00
More static analysis
This commit is contained in:
parent
095bc89aee
commit
41c3f1336a
@ -97,7 +97,7 @@ class BulkPowerActionCommand extends Command
|
||||
$instance->whereIn('id', $servers)->orWhereIn('node_id', $nodes);
|
||||
} elseif (empty($nodes) && !empty($servers)) {
|
||||
$instance->whereIn('id', $servers);
|
||||
} elseif (!empty($nodes) && empty($servers)) {
|
||||
} elseif (!empty($nodes)) {
|
||||
$instance->whereIn('node_id', $nodes);
|
||||
}
|
||||
|
||||
|
@ -55,10 +55,8 @@ class LoginCheckpointController extends AbstractLoginController
|
||||
$this->sendFailedLoginResponse($request);
|
||||
}
|
||||
|
||||
try {
|
||||
/** @var \App\Models\User $user */
|
||||
$user = User::query()->findOrFail($details['user_id']);
|
||||
} catch (ModelNotFoundException) {
|
||||
$user = User::query()->find($details['user_id']);
|
||||
if (!$user) {
|
||||
$this->sendFailedLoginResponse($request, null, self::TOKEN_EXPIRED_MESSAGE);
|
||||
}
|
||||
|
||||
|
@ -45,12 +45,9 @@ class LoginController extends AbstractLoginController
|
||||
$this->sendLockoutResponse($request);
|
||||
}
|
||||
|
||||
try {
|
||||
$username = $request->input('user');
|
||||
|
||||
/** @var \App\Models\User $user */
|
||||
$user = User::query()->where($this->getField($username), $username)->firstOrFail();
|
||||
} catch (ModelNotFoundException) {
|
||||
$username = $request->input('user');
|
||||
$user = User::query()->where($this->getField($username), $username)->first();
|
||||
if (!$user) {
|
||||
$this->sendFailedLoginResponse($request);
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,9 @@ class Node extends Model
|
||||
*/
|
||||
protected $hidden = ['daemon_token_id', 'daemon_token'];
|
||||
|
||||
private int $sum_memory;
|
||||
private int $sum_disk;
|
||||
|
||||
/**
|
||||
* Cast values to correct type.
|
||||
*/
|
||||
|
@ -54,8 +54,7 @@ class AssignmentService
|
||||
$underlying = gethostbyname($data['allocation_ip']);
|
||||
$parsed = Network::parse($underlying);
|
||||
} catch (\Exception $exception) {
|
||||
/* @noinspection PhpUndefinedVariableInspection */
|
||||
throw new DisplayException("Could not parse provided allocation IP address ({$underlying}): {$exception->getMessage()}", $exception);
|
||||
throw new DisplayException("Could not parse provided allocation IP address ({$data['allocation_ip']}): {$exception->getMessage()}", $exception);
|
||||
}
|
||||
|
||||
$this->connection->beginTransaction();
|
||||
|
@ -7,7 +7,7 @@ parameters:
|
||||
- app/
|
||||
|
||||
# Level 9 is the highest level
|
||||
level: 0
|
||||
level: 1
|
||||
|
||||
# ignoreErrors:
|
||||
# - '#PHPDoc tag @var#'
|
||||
|
Loading…
x
Reference in New Issue
Block a user