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

@ -36,7 +36,7 @@ trait Searchable
/**
* Perform a search of the model using the given term.
*
* @param string $term
* @param string $term
* @return $this
*/
public function search($term)

View file

@ -85,7 +85,8 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
public function createDatabase($database, $connection = null)
{
return $this->runStatement(
sprintf('CREATE DATABASE IF NOT EXISTS `%s`', $database), $connection
sprintf('CREATE DATABASE IF NOT EXISTS `%s`', $database),
$connection
);
}
@ -95,7 +96,8 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
public function createUser($username, $remote, $password, $connection = null)
{
return $this->runStatement(
sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\'', $username, $remote, $password), $connection
sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\'', $username, $remote, $password),
$connection
);
}
@ -107,7 +109,9 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
return $this->runStatement(
sprintf(
'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX ON `%s`.* TO `%s`@`%s`',
$database, $username, $remote
$database,
$username,
$remote
),
$connection
);
@ -127,7 +131,8 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
public function dropDatabase($database, $connection = null)
{
return $this->runStatement(
sprintf('DROP DATABASE IF EXISTS `%s`', $database), $connection
sprintf('DROP DATABASE IF EXISTS `%s`', $database),
$connection
);
}
@ -137,15 +142,16 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
public function dropUser($username, $remote, $connection = null)
{
return $this->runStatement(
sprintf('DROP USER IF EXISTS `%s`@`%s`', $username, $remote), $connection
sprintf('DROP USER IF EXISTS `%s`@`%s`', $username, $remote),
$connection
);
}
/**
* Run the provided statement against the database on a given connection.
*
* @param string $statement
* @param null|string $connection
* @param string $statement
* @param null|string $connection
* @return bool
*/
protected function runStatement($statement, $connection = null)

View file

@ -44,7 +44,7 @@ abstract class EloquentRepository extends Repository implements RepositoryInterf
/**
* {@inheritdoc}
* @param bool $force
* @param bool $force
* @return \Illuminate\Database\Eloquent\Model|bool
*/
public function create(array $fields, $validate = true, $force = false)
@ -214,7 +214,7 @@ abstract class EloquentRepository extends Repository implements RepositoryInterf
/**
* Insert multiple records into the database and ignore duplicates.
*
* @param array $values
* @param array $values
* @return bool
*/
public function insertIgnore(array $values)

View file

@ -47,7 +47,10 @@ class NodeRepository extends EloquentRepository implements NodeRepositoryInterfa
public function getUsageStats($id)
{
$node = $this->getBuilder()->select(
'nodes.disk_overallocate', 'nodes.memory_overallocate', 'nodes.disk', 'nodes.memory',
'nodes.disk_overallocate',
'nodes.memory_overallocate',
'nodes.disk',
'nodes.memory',
$this->getBuilder()->raw('SUM(servers.memory) as sum_memory, SUM(servers.disk) as sum_disk')
)->join('servers', 'servers.node_id', '=', 'nodes.id')
->where('nodes.id', $id)

View file

@ -72,7 +72,8 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa
}
return $users->paginate(
$this->config->get('pterodactyl.paginate.admin.users'), $this->getColumns()
$this->config->get('pterodactyl.paginate.admin.users'),
$this->getColumns()
);
}

View file

@ -52,8 +52,8 @@ class SubuserRepository
/**
* Creates a new subuser on the server.
*
* @param int $sid
* @param array $data
* @param int $sid
* @param array $data
* @return \Pterodactyl\Models\Subuser
*
* @throws \Pterodactyl\Exceptions\DisplayException
@ -152,8 +152,7 @@ class SubuserRepository
/**
* Revokes a users permissions on a server.
*
* @param int $id
* @return void
* @param int $id
*
* @throws \Pterodactyl\Exceptions\DisplayException
*/
@ -193,9 +192,8 @@ class SubuserRepository
/**
* Updates permissions for a given subuser.
*
* @param int $id
* @param array $data
* @return void
* @param int $id
* @param array $data
*
* @throws \Pterodactyl\Exceptions\DisplayException
* @throws \Pterodactyl\Exceptions\DisplayValidationException

View file

@ -64,7 +64,7 @@ abstract class Repository implements RepositoryInterface
/**
* Take the provided model and make it accessible to the rest of the repository.
*
* @param string|array $model
* @param string|array $model
* @return mixed
*/
protected function setModel($model)
@ -77,7 +77,8 @@ abstract class Repository implements RepositoryInterface
}
return $this->model = call_user_func(
$model[1], $this->app->make($model[0])
$model[1],
$this->app->make($model[0])
);
}
@ -102,7 +103,7 @@ abstract class Repository implements RepositoryInterface
/**
* Setup column selection functionality.
*
* @param array $columns
* @param array $columns
* @return $this
*/
public function withColumns($columns = ['*'])

View file

@ -48,9 +48,8 @@ class CommandRepository
/**
* Constuctor for repository.
*
* @param \Pterodactyl\Models\Server $server
* @param \Pterodactyl\Models\User|null $user
* @return void
* @param \Pterodactyl\Models\Server $server
* @param \Pterodactyl\Models\User|null $user
*/
public function __construct(Server $server, User $user = null)
{
@ -61,7 +60,7 @@ class CommandRepository
/**
* Sends a command to the daemon.
*
* @param string $command
* @param string $command
* @return string
*
* @throws \Pterodactyl\Exceptions\DisplayException

View file

@ -42,8 +42,7 @@ class FileRepository
/**
* Constructor.
*
* @param string $uuid
* @return void
* @param string $uuid
*/
public function __construct($uuid)
{
@ -53,7 +52,7 @@ class FileRepository
/**
* Get the contents of a requested file for the server.
*
* @param string $file
* @param string $file
* @return array
*
* @throws \GuzzleHttp\Exception\RequestException
@ -99,8 +98,8 @@ class FileRepository
/**
* Save the contents of a requested file on the daemon.
*
* @param string $file
* @param string $content
* @param string $file
* @param string $content
* @return bool
*
* @throws \GuzzleHttp\Exception\RequestException
@ -132,7 +131,7 @@ class FileRepository
/**
* Returns a listing of all files and folders within a specified directory on the daemon.
*
* @param string $directory
* @param string $directory
* @return object
*
* @throws \GuzzleHttp\Exception\RequestException

View file

@ -48,9 +48,8 @@ class PowerRepository
/**
* Constuctor for repository.
*
* @param \Pterodactyl\Models\Server $server
* @param \Pterodactyl\Models\User|null $user
* @return void
* @param \Pterodactyl\Models\Server $server
* @param \Pterodactyl\Models\User|null $user
*/
public function __construct(Server $server, User $user = null)
{
@ -61,7 +60,7 @@ class PowerRepository
/**
* Sends a power option to the daemon.
*
* @param string $action
* @param string $action
* @return string
*
* @throws \GuzzleHttp\Exception\RequestException
@ -89,8 +88,6 @@ class PowerRepository
/**
* Starts a server.
*
* @return void
*/
public function start()
{
@ -99,8 +96,6 @@ class PowerRepository
/**
* Stops a server.
*
* @return void
*/
public function stop()
{
@ -109,8 +104,6 @@ class PowerRepository
/**
* Restarts a server.
*
* @return void
*/
public function restart()
{
@ -119,8 +112,6 @@ class PowerRepository
/**
* Kills a server.
*
* @return void
*/
public function kill()
{