Apply php-cs-fixer changes

This commit is contained in:
Dane Everitt 2021-08-07 16:10:24 -07:00
parent cec96062e3
commit 436e686037
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
72 changed files with 91 additions and 196 deletions

View file

@ -45,9 +45,6 @@ class AdminRole extends Model
'permissions' => 'array',
];
/**
* @var array
*/
public static array $validationRules = [
'name' => 'required|string|max:64',
'description' => 'nullable|string|max:255',

View file

@ -50,9 +50,6 @@ class Allocation extends Model
'server_id' => 'integer',
];
/**
* @var array
*/
public static array $validationRules = [
'node_id' => 'required|exists:nodes,id',
'ip' => 'required|ip',

View file

@ -61,9 +61,6 @@ class AuditLog extends Model
*/
protected $table = 'audit_logs';
/**
* @var bool
*/
protected bool $immutableDates = true;
/**

View file

@ -37,9 +37,6 @@ class Backup extends Model
*/
protected $table = 'backups';
/**
* @var bool
*/
protected bool $immutableDates = true;
/**
@ -76,9 +73,6 @@ class Backup extends Model
*/
protected $guarded = ['id', 'created_at', 'updated_at', 'deleted_at'];
/**
* @var array
*/
public static array $validationRules = [
'server_id' => 'bail|required|numeric|exists:servers,id',
'uuid' => 'required|uuid',
@ -107,6 +101,6 @@ class Backup extends Model
{
return $this->hasMany(AuditLog::class, 'metadata->backup_uuid', 'uuid')
->where('action', 'LIKE', 'server:backup.%');
// ->where('metadata->backup_uuid', $this->uuid);
// ->where('metadata->backup_uuid', $this->uuid);
}
}

View file

@ -58,9 +58,6 @@ class Database extends Model
'max_connections' => 'integer',
];
/**
* @var array
*/
public static array $validationRules = [
'server_id' => 'required|numeric|exists:servers,id',
'database_host_id' => 'required|exists:database_hosts,id',

View file

@ -21,9 +21,6 @@ class DatabaseHost extends Model
*/
public const RESOURCE_NAME = 'database_host';
/**
* @var bool
*/
protected bool $immutableDates = true;
/**
@ -61,8 +58,6 @@ class DatabaseHost extends Model
/**
* Validation rules to assign to this model.
*
* @var array
*/
public static array $validationRules = [
'name' => 'required|string|max:191',

View file

@ -108,9 +108,6 @@ class Egg extends Model
'file_denylist' => 'array',
];
/**
* @var array
*/
public static array $validationRules = [
'nest_id' => 'required|bail|numeric|exists:nests,id',
'uuid' => 'required|string|size:36',

View file

@ -37,9 +37,6 @@ class EggVariable extends Model
*/
public const RESERVED_ENV_NAMES = 'SERVER_MEMORY,SERVER_IP,SERVER_PORT,ENV,HOME,USER,STARTUP,SERVER_UUID,UUID';
/**
* @var bool
*/
protected bool $immutableDates = true;
/**
@ -67,9 +64,6 @@ class EggVariable extends Model
'user_editable' => 'bool',
];
/**
* @var array
*/
public static array $validationRules = [
'egg_id' => 'exists:eggs,id',
'name' => 'required|string|between:1,191',

View file

@ -35,8 +35,6 @@ class Location extends Model
/**
* Rules ensuring that the raw data stored in the database meets expectations.
*
* @var array
*/
public static array $validationRules = [
'short' => 'required|string|between:1,60|unique:locations,short',

View file

@ -17,8 +17,6 @@ abstract class Model extends IlluminateModel
/**
* Set to true to return immutable Carbon date instances from the model.
*
* @var bool
*/
protected bool $immutableDates = false;
@ -42,9 +40,6 @@ abstract class Model extends IlluminateModel
*/
protected static $validatorFactory;
/**
* @var array
*/
public static array $validationRules = [];
/**
@ -82,8 +77,6 @@ abstract class Model extends IlluminateModel
/**
* Returns the validator instance used by this model.
*
* @return \Illuminate\Validation\Validator
*/
public function getValidator(): Validator
{

View file

@ -152,6 +152,7 @@ class Node extends Model
* Returns the configuration as an array.
*
* @return array
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function getConfiguration()
@ -186,6 +187,7 @@ class Node extends Model
* Returns the configuration in Yaml format.
*
* @return string
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function getYamlConfiguration()
@ -197,6 +199,7 @@ class Node extends Model
* Returns the configuration in JSON format.
*
* @return string
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function getJsonConfiguration(bool $pretty = false)

View file

@ -93,9 +93,6 @@ class Permission extends Model
'subuser_id' => 'integer',
];
/**
* @var array
*/
public static array $validationRules = [
'subuser_id' => 'required|numeric|min:1',
'permission' => 'required|string',

View file

@ -36,9 +36,6 @@ class PersonalAccessToken extends Model implements HasAbilities
'abilities',
];
/**
* @var array
*/
public static array $validationRules = [
'token' => 'required|string',
'token_id' => 'required|string|size:16',
@ -58,6 +55,7 @@ class PersonalAccessToken extends Model implements HasAbilities
* Required for support with Laravel Sanctum.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*
* @see \Laravel\Sanctum\Guard::supportsTokens()
*/
public function tokenable()
@ -69,6 +67,7 @@ class PersonalAccessToken extends Model implements HasAbilities
* Determine if the token has a given ability.
*
* @param string $ability
*
* @return bool
*/
public function can($ability)
@ -81,6 +80,7 @@ class PersonalAccessToken extends Model implements HasAbilities
* Determine if the token is missing a given ability.
*
* @param string $ability
*
* @return bool
*/
public function cant($ability)
@ -92,6 +92,7 @@ class PersonalAccessToken extends Model implements HasAbilities
* Find the token instance matching the given token.
*
* @param string $token
*
* @return \Pterodactyl\Models\PersonalAccessToken|null
*/
public static function findToken($token)
@ -108,8 +109,6 @@ class PersonalAccessToken extends Model implements HasAbilities
/**
* Generates a new identifier for a personal access token.
*
* @return string
*/
public static function generateTokenIdentifier(): string
{

View file

@ -58,9 +58,6 @@ class ServerTransfer extends Model
'archived' => 'bool',
];
/**
* @var array
*/
public static array $validationRules = [
'server_id' => 'required|numeric|exists:servers,id',
'old_node' => 'required|numeric',

View file

@ -21,9 +21,6 @@ class Setting extends Model
*/
protected $fillable = ['key', 'value'];
/**
* @var array
*/
public static array $validationRules = [
'key' => 'required|string|between:1,191',
'value' => 'string',

View file

@ -39,9 +39,6 @@ class Subuser extends Model
'permissions' => 'array',
];
/**
* @var array
*/
public static array $validationRules = [
'user_id' => 'required|numeric|exists:users,id',
'server_id' => 'required|numeric|exists:servers,id',

View file

@ -92,9 +92,6 @@ class Task extends Model
'continue_on_failure' => false,
];
/**
* @var array
*/
public static array $validationRules = [
'schedule_id' => 'required|numeric|exists:schedules,id',
'sequence_id' => 'required|numeric|min:1',

View file

@ -9,10 +9,10 @@ use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Builder;
use Pterodactyl\Models\Traits\HasAccessTokens;
use Illuminate\Auth\Passwords\CanResetPassword;
use Pterodactyl\Traits\Helpers\AvailableLanguages;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Pterodactyl\Traits\Helpers\AvailableLanguages;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
@ -111,8 +111,6 @@ class User extends Model implements
/**
* Rules verifying that the data being stored matches the expectations of the database.
*
* @var array
*/
public static array $validationRules = [
'uuid' => 'required|string|size:36|unique:users,uuid',
@ -173,8 +171,6 @@ class User extends Model implements
/**
* Gets the avatar url for the user.
*
* @return string
*/
public function avatarURL(): string
{
@ -183,10 +179,8 @@ class User extends Model implements
/**
* Gets the name of the role assigned to a user.
*
* @return string|null
*/
public function adminRoleName():? string
public function adminRoleName(): ?string
{
$role = $this->adminRole;
if (is_null($role)) {

View file

@ -20,7 +20,7 @@ class UserSSHKey extends Model
*/
public const RESOURCE_NAME = 'user_ssh_key';
const UPDATED_AT = null;
public const UPDATED_AT = null;
protected $table = 'user_ssh_keys';
protected bool $immutableDates = true;