Use more standardized phpcs
This commit is contained in:
parent
a043071e3c
commit
c449ca5155
493 changed files with 1116 additions and 3903 deletions
|
@ -8,32 +8,31 @@ use Illuminate\Notifications\Notifiable;
|
|||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $uuid
|
||||
* @property bool $public
|
||||
* @property string $name
|
||||
* @property string|null $description
|
||||
* @property int $location_id
|
||||
* @property string $fqdn
|
||||
* @property string $scheme
|
||||
* @property bool $behind_proxy
|
||||
* @property bool $maintenance_mode
|
||||
* @property int $memory
|
||||
* @property int $memory_overallocate
|
||||
* @property int $disk
|
||||
* @property int $disk_overallocate
|
||||
* @property int $upload_size
|
||||
* @property string $daemon_token_id
|
||||
* @property string $daemon_token
|
||||
* @property int $daemonListen
|
||||
* @property int $daemonSFTP
|
||||
* @property string $daemonBase
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
*
|
||||
* @property \Pterodactyl\Models\Location $location
|
||||
* @property \Pterodactyl\Models\Mount[]|\Illuminate\Database\Eloquent\Collection $mounts
|
||||
* @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers
|
||||
* @property int $id
|
||||
* @property string $uuid
|
||||
* @property bool $public
|
||||
* @property string $name
|
||||
* @property string|null $description
|
||||
* @property int $location_id
|
||||
* @property string $fqdn
|
||||
* @property string $scheme
|
||||
* @property bool $behind_proxy
|
||||
* @property bool $maintenance_mode
|
||||
* @property int $memory
|
||||
* @property int $memory_overallocate
|
||||
* @property int $disk
|
||||
* @property int $disk_overallocate
|
||||
* @property int $upload_size
|
||||
* @property string $daemon_token_id
|
||||
* @property string $daemon_token
|
||||
* @property int $daemonListen
|
||||
* @property int $daemonSFTP
|
||||
* @property string $daemonBase
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property \Pterodactyl\Models\Location $location
|
||||
* @property \Pterodactyl\Models\Mount[]|\Illuminate\Database\Eloquent\Collection $mounts
|
||||
* @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers
|
||||
* @property \Pterodactyl\Models\Allocation[]|\Illuminate\Database\Eloquent\Collection $allocations
|
||||
*/
|
||||
class Node extends Model
|
||||
|
@ -44,10 +43,10 @@ class Node extends Model
|
|||
* The resource name for this model when it is transformed into an
|
||||
* API representation using fractal.
|
||||
*/
|
||||
const RESOURCE_NAME = 'node';
|
||||
public const RESOURCE_NAME = 'node';
|
||||
|
||||
const DAEMON_TOKEN_ID_LENGTH = 16;
|
||||
const DAEMON_TOKEN_LENGTH = 64;
|
||||
public const DAEMON_TOKEN_ID_LENGTH = 16;
|
||||
public const DAEMON_TOKEN_LENGTH = 64;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
|
@ -133,8 +132,6 @@ class Node extends Model
|
|||
|
||||
/**
|
||||
* Get the connection address to use when making calls to this node.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getConnectionAddress(): string
|
||||
{
|
||||
|
@ -157,7 +154,7 @@ class Node extends Model
|
|||
'host' => '0.0.0.0',
|
||||
'port' => $this->daemonListen,
|
||||
'ssl' => [
|
||||
'enabled' => (! $this->behind_proxy && $this->scheme === 'https'),
|
||||
'enabled' => (!$this->behind_proxy && $this->scheme === 'https'),
|
||||
'cert' => '/etc/letsencrypt/live/' . $this->fqdn . '/fullchain.pem',
|
||||
'key' => '/etc/letsencrypt/live/' . $this->fqdn . '/privkey.pem',
|
||||
],
|
||||
|
@ -187,7 +184,6 @@ class Node extends Model
|
|||
/**
|
||||
* Returns the configuration in JSON format.
|
||||
*
|
||||
* @param bool $pretty
|
||||
* @return string
|
||||
*/
|
||||
public function getJsonConfiguration(bool $pretty = false)
|
||||
|
@ -197,8 +193,6 @@ class Node extends Model
|
|||
|
||||
/**
|
||||
* Helper function to return the decrypted key for a node.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDecryptedKey(): string
|
||||
{
|
||||
|
@ -247,10 +241,6 @@ class Node extends Model
|
|||
|
||||
/**
|
||||
* Returns a boolean if the node is viable for an additional server to be placed on it.
|
||||
*
|
||||
* @param int $memory
|
||||
* @param int $disk
|
||||
* @return bool
|
||||
*/
|
||||
public function isViable(int $memory, int $disk): bool
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue