Massive PHPCS linting

This commit is contained in:
Dane Everitt 2017-08-21 22:10:48 -05:00
parent 78c8b8d8ea
commit 3ee5803416
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
346 changed files with 834 additions and 1424 deletions

View file

@ -64,8 +64,8 @@ class AssignmentService
/**
* Insert allocations into the database and link them to a specific node.
*
* @param int|\Pterodactyl\Models\Node $node
* @param array $data
* @param int|\Pterodactyl\Models\Node $node
* @param array $data
*
* @throws \Pterodactyl\Exceptions\DisplayException
*/

View file

@ -76,9 +76,9 @@ class KeyService
/**
* Create a new API Key on the system with the given permissions.
*
* @param array $data
* @param array $permissions
* @param array $administrative
* @param array $data
* @param array $permissions
* @param array $administrative
* @return string
*
* @throws \Exception
@ -136,7 +136,7 @@ class KeyService
/**
* Delete the API key and associated permissions from the database.
*
* @param int $id
* @param int $id
* @return bool|null
*/
public function revoke($id)

View file

@ -46,8 +46,8 @@ class PermissionService
/**
* Store a permission key in the database.
*
* @param string $key
* @param string $permission
* @param string $key
* @param string $permission
* @return bool
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -33,9 +33,9 @@ class UuidService
* Generate a unique UUID validating against specified table and column.
* Defaults to `users.uuid`.
*
* @param string $table
* @param string $field
* @param int $type
* @param string $table
* @param string $field
* @param int $type
* @return string
* @deprecated
*/
@ -55,9 +55,9 @@ class UuidService
/**
* Generates a ShortUUID code which is 8 characters long and is used for identifying servers in the system.
*
* @param string $table
* @param string $field
* @param null|string $attachedUuid
* @param string $table
* @param string $field
* @param null|string $attachedUuid
* @return string
* @deprecated
*/

View file

@ -74,7 +74,7 @@ class DatabaseHostService
/**
* Create a new database host and persist it to the database.
*
* @param array $data
* @param array $data
* @return \Pterodactyl\Models\DatabaseHost
*
* @throws \Throwable
@ -106,8 +106,8 @@ class DatabaseHostService
/**
* Update a database host and persist to the database.
*
* @param int $id
* @param array $data
* @param int $id
* @param array $data
* @return mixed
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -135,7 +135,7 @@ class DatabaseHostService
/**
* Delete a database host if it has no active databases attached to it.
*
* @param int $id
* @param int $id
* @return bool|null
*
* @throws \Pterodactyl\Exceptions\DisplayException

View file

@ -74,8 +74,8 @@ class DatabaseManagementService
/**
* Create a new database that is linked to a specific host.
*
* @param int $server
* @param array $data
* @param int $server
* @param array $data
* @return \Illuminate\Database\Eloquent\Model
*
* @throws \Exception
@ -96,10 +96,16 @@ class DatabaseManagementService
$this->repository->createDatabase($database->database, 'dynamic');
$this->repository->createUser(
$database->username, $database->remote, $this->encrypter->decrypt($database->password), 'dynamic'
$database->username,
$database->remote,
$this->encrypter->decrypt($database->password),
'dynamic'
);
$this->repository->assignUserToDatabase(
$database->database, $database->username, $database->remote, 'dynamic'
$database->database,
$database->username,
$database->remote,
'dynamic'
);
$this->repository->flush('dynamic');
@ -125,8 +131,8 @@ class DatabaseManagementService
/**
* Change the password for a specific user and database combination.
*
* @param int $id
* @param string $password
* @param int $id
* @param string $password
* @return bool
*
* @throws \Exception
@ -148,7 +154,10 @@ class DatabaseManagementService
$this->repository->dropUser($database->username, $database->remote, 'dynamic');
$this->repository->createUser($database->username, $database->remote, $password, 'dynamic');
$this->repository->assignUserToDatabase(
$database->database, $database->username, $database->remote, 'dynamic'
$database->database,
$database->username,
$database->remote,
'dynamic'
);
$this->repository->flush('dynamic');
@ -164,7 +173,7 @@ class DatabaseManagementService
/**
* Delete a database from the given host server.
*
* @param int $id
* @param int $id
* @return bool|null
*/
public function delete($id)

View file

@ -67,7 +67,7 @@ class TemporaryPasswordService
/**
* Store a password reset token for a specific email address.
*
* @param string $email
* @param string $email
* @return string
*/
public function generateReset($email)

View file

@ -46,7 +46,7 @@ class LocationService
/**
* Create the location in the database and return it.
*
* @param array $data
* @param array $data
* @return \Pterodactyl\Models\Location
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -59,8 +59,8 @@ class LocationService
/**
* Update location model in the DB.
*
* @param int $id
* @param array $data
* @param int $id
* @param array $data
* @return \Pterodactyl\Models\Location
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -73,7 +73,7 @@ class LocationService
/**
* Delete a model from the DB.
*
* @param int $id
* @param int $id
* @return bool
*
* @throws \Pterodactyl\Exceptions\DisplayException

View file

@ -48,7 +48,7 @@ class CreationService
/**
* Create a new node on the panel.
*
* @param array $data
* @param array $data
* @return \Pterodactyl\Models\Node
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -68,8 +68,8 @@ class UpdateService
/**
* Update the configuration values for a given node on the machine.
*
* @param int|\Pterodactyl\Models\Node $node
* @param array $data
* @param int|\Pterodactyl\Models\Node $node
* @param array $data
* @return mixed
*
* @throws \Pterodactyl\Exceptions\DisplayException

View file

@ -33,10 +33,9 @@ class APILogService
/**
* Log an API Request.
*
* @param \Illuminate\Http\Request $request
* @param null|string $error
* @param bool $authorized
* @return void
* @param \Illuminate\Http\Request $request
* @param null|string $error
* @param bool $authorized
*/
public static function log(Request $request, $error = null, $authorized = false)
{

View file

@ -70,8 +70,7 @@ class DeploymentService
/**
* Set the location to use when auto-deploying.
*
* @param int|\Pterodactyl\Models\Location $location
* @return void
* @param int|\Pterodactyl\Models\Location $location
*/
public function setLocation($location)
{
@ -90,8 +89,7 @@ class DeploymentService
/**
* Set the node to use when auto-deploying.
*
* @param int|\Pterodactyl\Models\Node $node
* @return void
* @param int|\Pterodactyl\Models\Node $node
*/
public function setNode($node)
{
@ -108,8 +106,7 @@ class DeploymentService
/**
* Set the amount of disk space to be used by the new server.
*
* @param int $disk
* @return void
* @param int $disk
*/
public function setDisk(int $disk)
{
@ -121,8 +118,7 @@ class DeploymentService
/**
* Set the amount of memory to be used by the new server.
*
* @param int $memory
* @return void
* @param int $memory
*/
public function setMemory(int $memory)
{
@ -134,8 +130,7 @@ class DeploymentService
/**
* Return a random location model.
*
* @param array $exclude
* @return void;
* @param array $exclude
*/
protected function findLocation(array $exclude = [])
{
@ -154,8 +149,6 @@ class DeploymentService
/**
* Return a model instance of a random node.
*
* @return void;
*/
protected function findNode(array $exclude = [])
{
@ -240,8 +233,6 @@ class DeploymentService
/**
* Select and return the node to be used by the auto-deployment system.
*
* @return void
*/
public function select()
{

View file

@ -38,8 +38,6 @@ class VersionService
/**
* Version constructor.
*
* @return void
*/
public function __construct()
{

View file

@ -67,8 +67,8 @@ class ExportPackService
/**
* Prepare a pack for export.
*
* @param int|\Pterodactyl\Models\Pack $pack
* @param bool $files
* @param int|\Pterodactyl\Models\Pack $pack
* @param bool $files
* @return string
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException

View file

@ -74,8 +74,8 @@ class PackCreationService
/**
* Add a new service pack to the system.
*
* @param array $data
* @param \Illuminate\Http\UploadedFile|null $file
* @param array $data
* @param \Illuminate\Http\UploadedFile|null $file
* @return \Pterodactyl\Models\Pack
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -103,7 +103,8 @@ class PackCreationService
$this->connection->beginTransaction();
$pack = $this->repository->create(array_merge(
['uuid' => Uuid::uuid4()], $data
['uuid' => Uuid::uuid4()],
$data
));
$this->storage->disk()->makeDirectory('packs/' . $pack->uuid);

View file

@ -58,8 +58,8 @@ class PackUpdateService
/**
* Update a pack.
*
* @param int|\Pterodactyl\Models\Pack $pack
* @param array $data
* @param int|\Pterodactyl\Models\Pack $pack
* @param array $data
* @return bool
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -67,8 +67,8 @@ class TemplateUploadService
/**
* Process an uploaded file to create a new pack from a JSON or ZIP format.
*
* @param int $option
* @param \Illuminate\Http\UploadedFile $file
* @param int $option
* @param \Illuminate\Http\UploadedFile $file
* @return \Pterodactyl\Models\Pack
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -103,8 +103,8 @@ class TemplateUploadService
/**
* Process a ZIP file to create a pack and stored archive.
*
* @param int $option
* @param \Illuminate\Http\UploadedFile $file
* @param int $option
* @param \Illuminate\Http\UploadedFile $file
* @return \Pterodactyl\Models\Pack
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -97,8 +97,8 @@ class BuildModificationService
/**
* Set build array parameters.
*
* @param string $key
* @param mixed $value
* @param string $key
* @param mixed $value
*/
public function setBuild($key, $value)
{
@ -108,7 +108,7 @@ class BuildModificationService
/**
* Return the build array or an item out of the build array.
*
* @param string|null $attribute
* @param string|null $attribute
* @return array|mixed|null
*/
public function getBuild($attribute = null)
@ -123,8 +123,8 @@ class BuildModificationService
/**
* Change the build details for a specified server.
*
* @param int|\Pterodactyl\Models\Server $server
* @param array $data
* @param int|\Pterodactyl\Models\Server $server
* @param array $data
*
* @throws \Pterodactyl\Exceptions\DisplayException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -129,7 +129,7 @@ class CreationService
/**
* Create a server on both the panel and daemon.
*
* @param array $data
* @param array $data
* @return mixed
*
* @throws \Pterodactyl\Exceptions\DisplayException

View file

@ -100,7 +100,7 @@ class DeletionService
/**
* Set if the server should be forcibly deleted from the panel (ignoring daemon errors) or not.
*
* @param bool $bool
* @param bool $bool
* @return $this
*/
public function withForce($bool = true)

View file

@ -135,8 +135,8 @@ class DetailsModificationService
/**
* Update the docker container for a specified server.
*
* @param int|\Pterodactyl\Models\Server $server
* @param string $image
* @param int|\Pterodactyl\Models\Server $server
* @param string $image
*
* @throws \Pterodactyl\Exceptions\DisplayException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -59,8 +59,8 @@ class EnvironmentService
* Dynamically configure additional environment variables to be assigned
* with a specific server.
*
* @param string $key
* @param callable $closure
* @param string $key
* @param callable $closure
* @return $this
*/
public function setEnvironmentKey($key, callable $closure)
@ -74,7 +74,7 @@ class EnvironmentService
* Take all of the environment variables configured for this server and return
* them in an easy to process format.
*
* @param int|\Pterodactyl\Models\Server $server
* @param int|\Pterodactyl\Models\Server $server
* @return array
*/
public function process($server)

View file

@ -75,7 +75,7 @@ class ReinstallService
}
/**
* @param int|\Pterodactyl\Models\Server $server
* @param int|\Pterodactyl\Models\Server $server
*
* @throws \Pterodactyl\Exceptions\DisplayException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -107,7 +107,7 @@ class StartupModificationService
/**
* Determine if this function should run at an administrative level.
*
* @param bool $bool
* @param bool $bool
* @return $this
*/
public function isAdmin($bool = true)
@ -120,8 +120,8 @@ class StartupModificationService
/**
* Process startup modification for a server.
*
* @param int|\Pterodactyl\Models\Server $server
* @param array $data
* @param int|\Pterodactyl\Models\Server $server
* @param array $data
*
* @throws \Pterodactyl\Exceptions\DisplayException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -77,8 +77,8 @@ class SuspensionService
/**
* Suspends a server on the system.
*
* @param int|\Pterodactyl\Models\Server $server
* @param string $action
* @param int|\Pterodactyl\Models\Server $server
* @param string $action
* @return bool
*
* @throws \Pterodactyl\Exceptions\DisplayException
@ -93,7 +93,8 @@ class SuspensionService
if (! in_array($action, ['suspend', 'unsuspend'])) {
throw new \InvalidArgumentException(sprintf(
'Action must be either suspend or unsuspend, %s passed.', $action
'Action must be either suspend or unsuspend, %s passed.',
$action
));
}

View file

@ -30,8 +30,8 @@ class UsernameGenerationService
* Generate a unique username to be used for SFTP connections and identification
* of the server docker container on the host system.
*
* @param string $name
* @param null $identifier
* @param string $name
* @param null $identifier
* @return string
*/
public function generate($name, $identifier = null)

View file

@ -90,7 +90,7 @@ class VariableValidatorService
/**
* Set the fields with populated data to validate.
*
* @param array $fields
* @param array $fields
* @return $this
*/
public function setFields(array $fields)
@ -103,7 +103,7 @@ class VariableValidatorService
/**
* Set this function to be running at the administrative level.
*
* @param bool $bool
* @param bool $bool
* @return $this
*/
public function isAdmin($bool = true)
@ -116,7 +116,7 @@ class VariableValidatorService
/**
* Validate all of the passed data aganist the given service option variables.
*
* @param int $option
* @param int $option
* @return $this
*/
public function validate($option)

View file

@ -48,8 +48,8 @@ class InstallScriptUpdateService
/**
* Modify the option install script for a given service option.
*
* @param int|\Pterodactyl\Models\ServiceOption $option
* @param array $data
* @param int|\Pterodactyl\Models\ServiceOption $option
* @param array $data
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException

View file

@ -47,7 +47,7 @@ class OptionCreationService
/**
* Create a new service option and assign it to the given service.
*
* @param array $data
* @param array $data
* @return \Pterodactyl\Models\ServiceOption
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -57,7 +57,7 @@ class OptionDeletionService
/**
* Delete an option from the database if it has no active servers attached to it.
*
* @param int $option
* @param int $option
* @return int
*
* @throws \Pterodactyl\Exceptions\Service\HasActiveServersException

View file

@ -48,8 +48,8 @@ class OptionUpdateService
/**
* Update a service option.
*
* @param int|\Pterodactyl\Models\ServiceOption $option
* @param array $data
* @param int|\Pterodactyl\Models\ServiceOption $option
* @param array $data
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException

View file

@ -59,7 +59,7 @@ class ServiceCreationService
/**
* Create a new service on the system.
*
* @param array $data
* @param array $data
* @return \Pterodactyl\Models\Service
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -57,7 +57,7 @@ class ServiceDeletionService
/**
* Delete a service from the system only if there are no servers attached to it.
*
* @param int $service
* @param int $service
* @return int
*
* @throws \Pterodactyl\Exceptions\Service\HasActiveServersException

View file

@ -46,8 +46,8 @@ class ServiceUpdateService
/**
* Update a service and prevent changing the author once it is set.
*
* @param int $service
* @param array $data
* @param int $service
* @param array $data
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/

View file

@ -53,8 +53,8 @@ class VariableCreationService
/**
* Create a new variable for a given service option.
*
* @param int|\Pterodactyl\Models\ServiceOption $option
* @param array $data
* @param int|\Pterodactyl\Models\ServiceOption $option
* @param array $data
* @return \Pterodactyl\Models\ServiceVariable
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -68,7 +68,8 @@ class VariableCreationService
if (in_array(strtoupper(array_get($data, 'env_variable')), explode(',', ServiceVariable::RESERVED_ENV_NAMES))) {
throw new ReservedVariableNameException(sprintf(
'Cannot use the protected name %s for this environment variable.', array_get($data, 'env_variable')
'Cannot use the protected name %s for this environment variable.',
array_get($data, 'env_variable')
));
}

View file

@ -49,8 +49,8 @@ class VariableUpdateService
/**
* Update a specific service variable.
*
* @param int|\Pterodactyl\Models\ServiceVariable $variable
* @param array $data
* @param int|\Pterodactyl\Models\ServiceVariable $variable
* @param array $data
* @return mixed
*
* @throws \Pterodactyl\Exceptions\DisplayException

View file

@ -93,7 +93,7 @@ class CreationService
/**
* Create a new user on the system.
*
* @param array $data
* @param array $data
* @return \Pterodactyl\Models\User
*
* @throws \Exception

View file

@ -56,8 +56,8 @@ class UpdateService
/**
* Update the user model instance.
*
* @param int $id
* @param array $data
* @param int $id
* @param array $data
* @return mixed
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException