Use more standardized phpcs
This commit is contained in:
parent
a043071e3c
commit
c449ca5155
493 changed files with 1116 additions and 3903 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue