@@ -56,8 +56,7 @@ discard block |
||
| 56 | 56 | * @package Platine\Framework\Security\JWT\Signer |
| 57 | 57 | * @template T |
| 58 | 58 | */ |
| 59 | -class HMAC implements SignerInterface |
|
| 60 | -{ |
|
| 59 | +class HMAC implements SignerInterface { |
|
| 61 | 60 | /** |
| 62 | 61 | * The configuration instance |
| 63 | 62 | * @var Config<T> |
@@ -74,8 +73,7 @@ discard block |
||
| 74 | 73 | * Create new instance |
| 75 | 74 | * @param Config<T> $config |
| 76 | 75 | */ |
| 77 | - public function __construct(Config $config) |
|
| 78 | - { |
|
| 76 | + public function __construct(Config $config) { |
|
| 79 | 77 | $this->config = $config; |
| 80 | 78 | $algo = $config->get('api.sign.hmac.signature_algo', ''); |
| 81 | 79 | if (!in_array($algo, hash_hmac_algos())) { |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | * @class JWT |
| 58 | 58 | * @package Platine\Framework\Security\JWT |
| 59 | 59 | */ |
| 60 | -class JWT |
|
| 61 | -{ |
|
| 60 | +class JWT { |
|
| 62 | 61 | /** |
| 63 | 62 | * The payload |
| 64 | 63 | * @var array<string, mixed> |
@@ -147,9 +147,9 @@ |
||
| 147 | 147 | )); |
| 148 | 148 | } else { |
| 149 | 149 | $this->setHeaders($headers) |
| 150 | - ->setPayload($payload) |
|
| 151 | - ->setOriginalToken($token) |
|
| 152 | - ->setEncodedSignature($parts[2]); |
|
| 150 | + ->setPayload($payload) |
|
| 151 | + ->setOriginalToken($token) |
|
| 152 | + ->setEncodedSignature($parts[2]); |
|
| 153 | 153 | |
| 154 | 154 | if ($this->verify() === false) { |
| 155 | 155 | throw new InvalidTokenException(sprintf( |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class Base64UrlSafeEncoder |
| 54 | 54 | * @package Platine\Framework\Security\JWT\Encoder |
| 55 | 55 | */ |
| 56 | -class Base64UrlSafeEncoder implements EncoderInterface |
|
| 57 | -{ |
|
| 56 | +class Base64UrlSafeEncoder implements EncoderInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * {@inheritdoc} |
| 60 | 59 | */ |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class EncoderInterface |
| 52 | 52 | * @package Platine\Framework\Security\JWT |
| 53 | 53 | */ |
| 54 | -interface EncoderInterface |
|
| 55 | -{ |
|
| 54 | +interface EncoderInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * Encode the given data |
| 58 | 57 | * @param string $data |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class AuthorizationInterface |
| 52 | 52 | * @package Platine\Framework\Auth |
| 53 | 53 | */ |
| 54 | -interface AuthorizationInterface |
|
| 55 | -{ |
|
| 54 | +interface AuthorizationInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * Check if user is granted the given permission |
| 58 | 57 | * @param string $permission the permission to check |
@@ -56,8 +56,7 @@ |
||
| 56 | 56 | * @class AuthenticationInterface |
| 57 | 57 | * @package Platine\Framework\Auth |
| 58 | 58 | */ |
| 59 | -interface AuthenticationInterface |
|
| 60 | -{ |
|
| 59 | +interface AuthenticationInterface { |
|
| 61 | 60 | /** |
| 62 | 61 | * Authenticate the user |
| 63 | 62 | * @param array<string, mixed> $credentials |
@@ -104,5 +104,5 @@ |
||
| 104 | 104 | * |
| 105 | 105 | * @throws AccountNotFoundException if can not find the account information |
| 106 | 106 | */ |
| 107 | - public function getId(): int|string; |
|
| 107 | + public function getId(): int | string; |
|
| 108 | 108 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class IdentityInterface |
| 52 | 52 | * @package Platine\Framework\Auth |
| 53 | 53 | */ |
| 54 | -interface IdentityInterface |
|
| 55 | -{ |
|
| 54 | +interface IdentityInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * Return the id of the current user |
| 58 | 57 | * @return mixed |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * @class RouteMatchMiddleware |
| 61 | 61 | * @package Platine\Framework\Http\Middleware |
| 62 | 62 | */ |
| 63 | -class RouteMatchMiddleware implements MiddlewareInterface |
|
| 64 | -{ |
|
| 63 | +class RouteMatchMiddleware implements MiddlewareInterface { |
|
| 65 | 64 | /** |
| 66 | 65 | * The Router instance |
| 67 | 66 | * @var Router |
@@ -79,8 +78,7 @@ discard block |
||
| 79 | 78 | * @param Router $router |
| 80 | 79 | * @param array<string> $allowedMethods the default allowed methods |
| 81 | 80 | */ |
| 82 | - public function __construct(Router $router, array $allowedMethods = ['HEAD']) |
|
| 83 | - { |
|
| 81 | + public function __construct(Router $router, array $allowedMethods = ['HEAD']) { |
|
| 84 | 82 | $this->router = $router; |
| 85 | 83 | |
| 86 | 84 | foreach ($allowedMethods as $method) { |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * @class TemplateResponse |
| 55 | 55 | * @package Platine\Framework\Http\Response |
| 56 | 56 | */ |
| 57 | -class TemplateResponse extends Response |
|
| 58 | -{ |
|
| 57 | +class TemplateResponse extends Response { |
|
| 59 | 58 | /** |
| 60 | 59 | * The template instance |
| 61 | 60 | * @var Template |