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

@ -42,8 +42,6 @@ class BackupManager
/**
* BackupManager constructor.
*
* @param \Illuminate\Foundation\Application $app
*/
public function __construct(Application $app)
{
@ -54,7 +52,6 @@ class BackupManager
/**
* Returns a backup adapter instance.
*
* @param string|null $name
* @return \League\Flysystem\AdapterInterface
*/
public function adapter(string $name = null)
@ -65,8 +62,8 @@ class BackupManager
/**
* Set the given backup adapter instance.
*
* @param string $name
* @param \League\Flysystem\AdapterInterface $disk
*
* @return $this
*/
public function set(string $name, $disk)
@ -79,7 +76,6 @@ class BackupManager
/**
* Gets a backup adapter.
*
* @param string $name
* @return \League\Flysystem\AdapterInterface
*/
protected function get(string $name)
@ -90,7 +86,6 @@ class BackupManager
/**
* Resolve the given backup disk.
*
* @param string $name
* @return \League\Flysystem\AdapterInterface
*/
protected function resolve(string $name)
@ -98,9 +93,7 @@ class BackupManager
$config = $this->getConfig($name);
if (empty($config['adapter'])) {
throw new InvalidArgumentException(
"Backup disk [{$name}] does not have a configured adapter."
);
throw new InvalidArgumentException("Backup disk [{$name}] does not have a configured adapter.");
}
$adapter = $config['adapter'];
@ -124,7 +117,6 @@ class BackupManager
/**
* Calls a custom creator for a given adapter type.
*
* @param array $config
* @return \League\Flysystem\AdapterInterface
*/
protected function callCustomCreator(array $config)
@ -139,7 +131,6 @@ class BackupManager
/**
* Creates a new wings adapter.
*
* @param array $config
* @return \League\Flysystem\AdapterInterface
*/
public function createWingsAdapter(array $config)
@ -150,14 +141,13 @@ class BackupManager
/**
* Creates a new S3 adapter.
*
* @param array $config
* @return \League\Flysystem\AdapterInterface
*/
public function createS3Adapter(array $config)
{
$config['version'] = 'latest';
if (! empty($config['key']) && ! empty($config['secret'])) {
if (!empty($config['key']) && !empty($config['secret'])) {
$config['credentials'] = Arr::only($config, ['key', 'secret', 'token']);
}
@ -169,7 +159,6 @@ class BackupManager
/**
* Returns the configuration associated with a given backup type.
*
* @param string $name
* @return array
*/
protected function getConfig(string $name)
@ -189,8 +178,6 @@ class BackupManager
/**
* Set the default session driver name.
*
* @param string $name
*/
public function setDefaultAdapter(string $name)
{
@ -201,6 +188,7 @@ class BackupManager
* Unset the given adapter instances.
*
* @param string|string[] $adapter
*
* @return $this
*/
public function forget($adapter)
@ -215,8 +203,6 @@ class BackupManager
/**
* Register a custom adapter creator closure.
*
* @param string $adapter
* @param \Closure $callback
* @return $this
*/
public function extend(string $adapter, Closure $callback)

View file

@ -16,9 +16,9 @@ use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface;
class DynamicDatabaseConnection
{
const DB_CHARSET = 'utf8';
const DB_COLLATION = 'utf8_unicode_ci';
const DB_DRIVER = 'mysql';
public const DB_CHARSET = 'utf8';
public const DB_COLLATION = 'utf8_unicode_ci';
public const DB_DRIVER = 'mysql';
/**
* @var \Illuminate\Config\Repository
@ -37,10 +37,6 @@ class DynamicDatabaseConnection
/**
* DynamicDatabaseConnection constructor.
*
* @param \Illuminate\Config\Repository $config
* @param \Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface $repository
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
*/
public function __construct(
ConfigRepository $config,
@ -55,15 +51,15 @@ class DynamicDatabaseConnection
/**
* Adds a dynamic database connection entry to the runtime config.
*
* @param string $connection
* @param string $connection
* @param \Pterodactyl\Models\DatabaseHost|int $host
* @param string $database
* @param string $database
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function set($connection, $host, $database = 'mysql')
{
if (! $host instanceof DatabaseHost) {
if (!$host instanceof DatabaseHost) {
$host = $this->repository->find($host);
}

View file

@ -20,7 +20,7 @@ class Hashids extends VendorHashids implements HashidsInterface
public function decodeFirst($encoded, $default = null)
{
$result = $this->decode($encoded);
if (! is_array($result)) {
if (!is_array($result)) {
return $default;
}

View file

@ -13,14 +13,11 @@ final class TimestampDates implements ClaimsFormatter
* by Wings and will cause a flood of errors and panic conditions because the times
* cannot be parsed correctly. The default is time with microseconds, we just need
* to use the normal unix timestamp here.
*
* @param array $claims
* @return array
*/
public function formatClaims(array $claims): array
{
foreach (RegisteredClaims::DATE_CLAIMS as $claim) {
if (! array_key_exists($claim, $claims)) {
if (!array_key_exists($claim, $claims)) {
continue;
}

View file

@ -10,7 +10,7 @@ class PterodactylSerializer extends ArraySerializer
* Serialize an item.
*
* @param string $resourceKey
* @param array $data
*
* @return array
*/
public function item($resourceKey, array $data)
@ -25,7 +25,7 @@ class PterodactylSerializer extends ArraySerializer
* Serialize a collection.
*
* @param string $resourceKey
* @param array $data
*
* @return array
*/
public function collection($resourceKey, array $data)
@ -59,6 +59,7 @@ class PterodactylSerializer extends ArraySerializer
*
* @param array $transformedData
* @param array $includedData
*
* @return array
*/
public function mergeIncludes($transformedData, $includedData)

View file

@ -22,7 +22,7 @@ class Fractal extends SpatieFractal
{
// Set the serializer by default.
if (is_null($this->serializer)) {
$this->serializer = new PterodactylSerializer;
$this->serializer = new PterodactylSerializer();
}
// Automatically set the paginator on the response object if the