@@ -21,10 +21,10 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public static function mapEntity(EntityMapperInterface $mapper): void |
| 23 | 23 | { |
| 24 | - $mapper->useTimestamp(); |
|
| 25 | - $mapper->casts([ |
|
| 24 | + $mapper->useTimestamp(); |
|
| 25 | + $mapper->casts([ |
|
| 26 | 26 | 'created_at' => 'date', |
| 27 | 27 | 'updated_at' => '?date', |
| 28 | - ]); |
|
| 28 | + ]); |
|
| 29 | 29 | } |
| 30 | 30 | } |
@@ -12,8 +12,7 @@ |
||
| 12 | 12 | * @package Platine\Framework\OAuth2\Entity |
| 13 | 13 | * @extends Entity<OauthClient> |
| 14 | 14 | */ |
| 15 | -class OauthClient extends Entity |
|
| 16 | -{ |
|
| 15 | +class OauthClient extends Entity { |
|
| 17 | 16 | /** |
| 18 | 17 | * |
| 19 | 18 | * @param EntityMapperInterface<OauthClient> $mapper |
@@ -12,8 +12,7 @@ |
||
| 12 | 12 | * @package Platine\Framework\OAuth2\Entity |
| 13 | 13 | * @extends Entity<OauthScope> |
| 14 | 14 | */ |
| 15 | -class OauthScope extends Entity |
|
| 16 | -{ |
|
| 15 | +class OauthScope extends Entity { |
|
| 17 | 16 | /** |
| 18 | 17 | * |
| 19 | 18 | * @param EntityMapperInterface<OauthScope> $mapper |
@@ -21,10 +21,10 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public static function mapEntity(EntityMapperInterface $mapper): void |
| 23 | 23 | { |
| 24 | - $mapper->useTimestamp(); |
|
| 25 | - $mapper->casts([ |
|
| 24 | + $mapper->useTimestamp(); |
|
| 25 | + $mapper->casts([ |
|
| 26 | 26 | 'created_at' => 'date', |
| 27 | 27 | 'updated_at' => '?date', |
| 28 | - ]); |
|
| 28 | + ]); |
|
| 29 | 29 | } |
| 30 | 30 | } |
@@ -20,12 +20,12 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public static function mapEntity(EntityMapperInterface $mapper): void |
| 22 | 22 | { |
| 23 | - $mapper->primaryKey('refresh_token'); |
|
| 24 | - $mapper->useTimestamp(); |
|
| 25 | - $mapper->casts([ |
|
| 23 | + $mapper->primaryKey('refresh_token'); |
|
| 24 | + $mapper->useTimestamp(); |
|
| 25 | + $mapper->casts([ |
|
| 26 | 26 | 'expires' => 'date', |
| 27 | 27 | 'created_at' => 'date', |
| 28 | 28 | 'updated_at' => '?date', |
| 29 | - ]); |
|
| 29 | + ]); |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -12,8 +12,7 @@ |
||
| 12 | 12 | * @package Platine\Framework\OAuth2\Entity |
| 13 | 13 | * @extends Entity<OauthRefreshToken> |
| 14 | 14 | */ |
| 15 | -class OauthRefreshToken extends Entity |
|
| 16 | -{ |
|
| 15 | +class OauthRefreshToken extends Entity { |
|
| 17 | 16 | /** |
| 18 | 17 | * @param EntityMapperInterface<OauthRefreshToken> $mapper |
| 19 | 18 | * @return void |
@@ -21,12 +21,12 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public static function mapEntity(EntityMapperInterface $mapper): void |
| 23 | 23 | { |
| 24 | - $mapper->primaryKey('access_token'); |
|
| 25 | - $mapper->useTimestamp(); |
|
| 26 | - $mapper->casts([ |
|
| 24 | + $mapper->primaryKey('access_token'); |
|
| 25 | + $mapper->useTimestamp(); |
|
| 26 | + $mapper->casts([ |
|
| 27 | 27 | 'expires' => 'date', |
| 28 | 28 | 'created_at' => 'date', |
| 29 | 29 | 'updated_at' => '?date', |
| 30 | - ]); |
|
| 30 | + ]); |
|
| 31 | 31 | } |
| 32 | 32 | } |
@@ -12,8 +12,7 @@ |
||
| 12 | 12 | * @package Platine\Framework\OAuth2\Entity |
| 13 | 13 | * @extends Entity<OauthAccessToken> |
| 14 | 14 | */ |
| 15 | -class OauthAccessToken extends Entity |
|
| 16 | -{ |
|
| 15 | +class OauthAccessToken extends Entity { |
|
| 17 | 16 | /** |
| 18 | 17 | * |
| 19 | 18 | * @param EntityMapperInterface<OauthAccessToken> $mapper |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @class SessionUser |
| 54 | 54 | * @package Platine\Framework\Audit |
| 55 | 55 | */ |
| 56 | -class SessionUser implements AuditUserInterface |
|
| 57 | -{ |
|
| 56 | +class SessionUser implements AuditUserInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * The Authentication instance |
| 60 | 59 | * @var AuthenticationInterface |
@@ -66,8 +65,7 @@ discard block |
||
| 66 | 65 | * Create new instance |
| 67 | 66 | * @param AuthenticationInterface $authentication |
| 68 | 67 | */ |
| 69 | - public function __construct(AuthenticationInterface $authentication) |
|
| 70 | - { |
|
| 68 | + public function __construct(AuthenticationInterface $authentication) { |
|
| 71 | 69 | $this->authentication = $authentication; |
| 72 | 70 | } |
| 73 | 71 | |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class AuditUserInterface |
| 52 | 52 | * @package Platine\Framework\Audit |
| 53 | 53 | */ |
| 54 | -interface AuditUserInterface |
|
| 55 | -{ |
|
| 54 | +interface AuditUserInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * Return the user id |
| 58 | 57 | * @return int |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @class ApiUser |
| 54 | 54 | * @package Platine\Framework\Audit |
| 55 | 55 | */ |
| 56 | -class ApiUser implements AuditUserInterface |
|
| 57 | -{ |
|
| 56 | +class ApiUser implements AuditUserInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * The API Authentication instance |
| 60 | 59 | * @var ApiAuthenticationInterface |
@@ -66,8 +65,7 @@ discard block |
||
| 66 | 65 | * Create new instance |
| 67 | 66 | * @param ApiAuthenticationInterface $authentication |
| 68 | 67 | */ |
| 69 | - public function __construct(ApiAuthenticationInterface $authentication) |
|
| 70 | - { |
|
| 68 | + public function __construct(ApiAuthenticationInterface $authentication) { |
|
| 71 | 69 | $this->authentication = $authentication; |
| 72 | 70 | } |
| 73 | 71 | |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | ?CsrfStorageInterface $storage = null |
| 88 | 88 | ) { |
| 89 | 89 | $this->config = $config; |
| 90 | - $this->storage = $storage ?? new CsrfNullStorage(); |
|
| 90 | + $this->storage = $storage ?? new CsrfNullStorage(); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | * @package Platine\Framework\Security\Csrf |
| 60 | 60 | * @template T |
| 61 | 61 | */ |
| 62 | -class CsrfManager |
|
| 63 | -{ |
|
| 62 | +class CsrfManager { |
|
| 64 | 63 | /** |
| 65 | 64 | * The application configuration class |
| 66 | 65 | * @var Config<T> |
@@ -188,8 +187,7 @@ discard block |
||
| 188 | 187 | * @param string $key |
| 189 | 188 | * @return mixed |
| 190 | 189 | */ |
| 191 | - private function getConfigValue(string $key) |
|
| 192 | - { |
|
| 190 | + private function getConfigValue(string $key) { |
|
| 193 | 191 | $config = $this->config->get('security.csrf', []); |
| 194 | 192 | |
| 195 | 193 | return $config[$key] ?? null; |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class CsrfStorageInterface |
| 52 | 52 | * @package Platine\Framework\Security\Csrf |
| 53 | 53 | */ |
| 54 | -interface CsrfStorageInterface |
|
| 55 | -{ |
|
| 54 | +interface CsrfStorageInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * Return the token information from storage |
| 58 | 57 | * @param string $name |