Turns out I hate that huge space formatting, disable that mess

This commit is contained in:
Dane Everitt 2021-01-27 20:52:11 -08:00
parent 0ae90eacaa
commit 5515871b2f
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
34 changed files with 318 additions and 322 deletions

View file

@ -23,6 +23,17 @@ return (new Config())
'ordered_imports' => [
'sortAlgorithm' => 'length',
],
'phpdoc_align' => [
'align' => 'left',
'tags' => [
'param',
'property',
'return',
'throws',
'type',
'var',
],
],
'random_api_migration' => true,
'ternary_to_null_coalescing' => true,
'yoda_style' => [

View file

@ -2,8 +2,16 @@
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property int $server_id
* @property int $variable_id
* @property string $variable_value
* @property \Carbon\CarbonImmutable|null $created_at
* @property \Carbon\CarbonImmutable|null $updated_at
* @property \Pterodactyl\Models\EggVariable $variable
* @property \Pterodactyl\Models\Server $server
*/
class ServerVariable extends Model
{
/**
@ -12,58 +20,36 @@ class ServerVariable extends Model
*/
public const RESOURCE_NAME = 'server_variable';
/**
* The table associated with the model.
*
* @var string
*/
/** @var bool */
protected $immutableDates = true;
/** @var string */
protected $table = 'server_variables';
/**
* Fields that are not mass assignable.
*
* @var array
*/
/** @var string[] */
protected $guarded = ['id', 'created_at', 'updated_at'];
/**
* Cast values to correct type.
*
* @var array
*/
/** @var string[] */
protected $casts = [
'server_id' => 'integer',
'variable_id' => 'integer',
];
/**
* Determine if variable is viewable by users.
*
* @return bool
*/
public function getUserCanViewAttribute()
{
return (bool) $this->variable->user_viewable;
}
/** @var string[] */
public static $validationRules = [
'server_id' => 'required|int',
'variable_id' => 'required|int',
'variable_value' => 'string',
];
/**
* Determine if variable is editable by users.
* Returns the server this variable is associated with.
*
* @return bool
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function getUserCanEditAttribute()
public function server()
{
return (bool) $this->variable->user_editable;
}
/**
* Determine if variable is required.
*
* @return bool
*/
public function getRequiredAttribute()
{
return $this->variable->required;
return $this->belongsTo(Server::class);
}
/**

View file

@ -3,8 +3,8 @@
namespace Pterodactyl\Services\Eggs\Sharing;
use Ramsey\Uuid\Uuid;
use Pterodactyl\Models\Egg;
use Illuminate\Support\Arr;
use Pterodactyl\Models\Egg;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Collection;
use Illuminate\Database\ConnectionInterface;

View file

@ -5,7 +5,6 @@ namespace Pterodactyl\Transformers\Api\Application;
use Pterodactyl\Models\Egg;
use Pterodactyl\Models\Nest;
use Pterodactyl\Models\Server;
use Illuminate\Support\Collection;
use Pterodactyl\Models\EggVariable;
use Pterodactyl\Services\Acl\Api\AdminAcl;

View file

@ -68,7 +68,7 @@
}
},
"scripts": {
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist --rules=psr_autoloading",
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist",
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],

View file

@ -1,8 +1,8 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateFileDenylistToJson extends Migration
{