Use more standardized phpcs

This commit is contained in:
Dane Everitt 2021-01-23 12:33:34 -08:00
parent a043071e3c
commit c449ca5155
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
493 changed files with 1116 additions and 3903 deletions

View file

@ -11,35 +11,33 @@ class AdminAcl
* Resource permission columns in the api_keys table begin
* with this identifier.
*/
const COLUMN_IDENTIFIER = 'r_';
public const COLUMN_IDENTIFIER = 'r_';
/**
* The different types of permissions available for API keys. This
* implements a read/write/none permissions scheme for all endpoints.
*/
const NONE = 0;
const READ = 1;
const WRITE = 2;
public const NONE = 0;
public const READ = 1;
public const WRITE = 2;
/**
* Resources that are available on the API and can contain a permissions
* set for each key. These are stored in the database as r_{resource}.
*/
const RESOURCE_SERVERS = 'servers';
const RESOURCE_NODES = 'nodes';
const RESOURCE_ALLOCATIONS = 'allocations';
const RESOURCE_USERS = 'users';
const RESOURCE_LOCATIONS = 'locations';
const RESOURCE_NESTS = 'nests';
const RESOURCE_EGGS = 'eggs';
const RESOURCE_DATABASE_HOSTS = 'database_hosts';
const RESOURCE_SERVER_DATABASES = 'server_databases';
public const RESOURCE_SERVERS = 'servers';
public const RESOURCE_NODES = 'nodes';
public const RESOURCE_ALLOCATIONS = 'allocations';
public const RESOURCE_USERS = 'users';
public const RESOURCE_LOCATIONS = 'locations';
public const RESOURCE_NESTS = 'nests';
public const RESOURCE_EGGS = 'eggs';
public const RESOURCE_DATABASE_HOSTS = 'database_hosts';
public const RESOURCE_SERVER_DATABASES = 'server_databases';
/**
* Determine if an API key has permission to perform a specific read/write operation.
*
* @param int $permission
* @param int $action
* @return bool
*/
public static function can(int $permission, int $action = self::READ)
@ -55,9 +53,6 @@ class AdminAcl
* Determine if an API Key model has permission to access a given resource
* at a specific action level.
*
* @param \Pterodactyl\Models\ApiKey $key
* @param string $resource
* @param int $action
* @return bool
*/
public static function check(ApiKey $key, string $resource, int $action = self::READ)
@ -68,7 +63,6 @@ class AdminAcl
/**
* Return a list of all resource constants defined in this ACL.
*
* @return array
* @throws \ReflectionException
*/
public static function getResourceList(): array