Use more standardized phpcs
This commit is contained in:
parent
a043071e3c
commit
c449ca5155
493 changed files with 1116 additions and 3903 deletions
|
@ -22,9 +22,6 @@ class NodeCreationService
|
|||
|
||||
/**
|
||||
* CreationService constructor.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
|
||||
* @param \Pterodactyl\Contracts\Repository\NodeRepositoryInterface $repository
|
||||
*/
|
||||
public function __construct(Encrypter $encrypter, NodeRepositoryInterface $repository)
|
||||
{
|
||||
|
@ -35,7 +32,6 @@ class NodeCreationService
|
|||
/**
|
||||
* Create a new node on the panel.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Pterodactyl\Models\Node
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
|
|
|
@ -34,10 +34,6 @@ class NodeDeletionService
|
|||
|
||||
/**
|
||||
* DeletionService constructor.
|
||||
*
|
||||
* @param \Pterodactyl\Contracts\Repository\NodeRepositoryInterface $repository
|
||||
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $serverRepository
|
||||
* @param \Illuminate\Contracts\Translation\Translator $translator
|
||||
*/
|
||||
public function __construct(
|
||||
NodeRepositoryInterface $repository,
|
||||
|
@ -53,6 +49,7 @@ class NodeDeletionService
|
|||
* Delete a node from the panel if no servers are attached to it.
|
||||
*
|
||||
* @param int|\Pterodactyl\Models\Node $node
|
||||
*
|
||||
* @return bool|null
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Service\HasActiveServersException
|
||||
|
|
|
@ -31,7 +31,6 @@ class NodeJWTService
|
|||
/**
|
||||
* Set the claims to include in this JWT.
|
||||
*
|
||||
* @param array $claims
|
||||
* @return $this
|
||||
*/
|
||||
public function setClaims(array $claims)
|
||||
|
@ -42,7 +41,6 @@ class NodeJWTService
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \DateTimeImmutable $date
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpiresAt(DateTimeImmutable $date)
|
||||
|
@ -53,7 +51,6 @@ class NodeJWTService
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $subject
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubject(string $subject)
|
||||
|
@ -66,17 +63,16 @@ class NodeJWTService
|
|||
/**
|
||||
* Generate a new JWT for a given node.
|
||||
*
|
||||
* @param \Pterodactyl\Models\Node $node
|
||||
* @param string|null $identifiedBy
|
||||
* @param string $algo
|
||||
*
|
||||
* @return \Lcobucci\JWT\Token\Plain
|
||||
*/
|
||||
public function handle(Node $node, string $identifiedBy, string $algo = 'md5')
|
||||
{
|
||||
$identifier = hash($algo, $identifiedBy);
|
||||
$config = Configuration::forSymmetricSigner(new Sha256, InMemory::plainText($node->getDecryptedKey()));
|
||||
$config = Configuration::forSymmetricSigner(new Sha256(), InMemory::plainText($node->getDecryptedKey()));
|
||||
|
||||
$builder = $config->builder(new TimestampDates)
|
||||
$builder = $config->builder(new TimestampDates())
|
||||
->issuedBy(config('app.url'))
|
||||
->permittedFor($node->getConnectionAddress())
|
||||
->identifiedBy($identifier)
|
||||
|
@ -88,7 +84,7 @@ class NodeJWTService
|
|||
$builder = $builder->expiresAt($this->expiresAt);
|
||||
}
|
||||
|
||||
if (! empty($this->subject)) {
|
||||
if (!empty($this->subject)) {
|
||||
$builder = $builder->relatedTo($this->subject)->withHeader('sub', $this->subject);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,11 +36,6 @@ class NodeUpdateService
|
|||
|
||||
/**
|
||||
* UpdateService constructor.
|
||||
*
|
||||
* @param \Illuminate\Database\ConnectionInterface $connection
|
||||
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
|
||||
* @param \Pterodactyl\Repositories\Wings\DaemonConfigurationRepository $configurationRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $repository
|
||||
*/
|
||||
public function __construct(
|
||||
ConnectionInterface $connection,
|
||||
|
@ -57,11 +52,8 @@ class NodeUpdateService
|
|||
/**
|
||||
* Update the configuration values for a given node on the machine.
|
||||
*
|
||||
* @param \Pterodactyl\Models\Node $node
|
||||
* @param array $data
|
||||
* @param bool $resetToken
|
||||
*
|
||||
* @return \Pterodactyl\Models\Node
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function handle(Node $node, array $data, bool $resetToken = false)
|
||||
|
|
Reference in a new issue