@@ -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 |
@@ -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 |
@@ -185,11 +185,11 @@ |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | $data = [ |
188 | - 'id' => $user->id, |
|
189 | - 'username' => $user->username, |
|
190 | - 'lastname' => $user->lastname, |
|
191 | - 'firstname' => $user->firstname, |
|
192 | - 'permissions' => array_unique($permissions), |
|
188 | + 'id' => $user->id, |
|
189 | + 'username' => $user->username, |
|
190 | + 'lastname' => $user->lastname, |
|
191 | + 'firstname' => $user->firstname, |
|
192 | + 'permissions' => array_unique($permissions), |
|
193 | 193 | ]; |
194 | 194 | |
195 | 195 | $this->session->set('user', array_merge($data, $this->getUserData($user))); |
@@ -66,8 +66,7 @@ |
||
66 | 66 | * class SessionAuthentication |
67 | 67 | * @package Platine\Framework\Auth\Authentication |
68 | 68 | */ |
69 | -class SessionAuthentication implements AuthenticationInterface |
|
70 | -{ |
|
69 | +class SessionAuthentication implements AuthenticationInterface { |
|
71 | 70 | /** |
72 | 71 | * Create new instance |
73 | 72 | * @param Application $app |
@@ -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 @@ |
||
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> |
@@ -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 |
@@ -74,7 +74,7 @@ |
||
74 | 74 | */ |
75 | 75 | public function set(string $name, string $token, int $expire): void |
76 | 76 | { |
77 | - $this->data[$name] = $token; |
|
77 | + $this->data[$name] = $token; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -53,8 +53,7 @@ |
||
53 | 53 | * @class CsrfNullStorage |
54 | 54 | * @package Platine\Framework\Security\Csrf\Storage |
55 | 55 | */ |
56 | -class CsrfNullStorage implements CsrfStorageInterface |
|
57 | -{ |
|
56 | +class CsrfNullStorage implements CsrfStorageInterface { |
|
58 | 57 | /** |
59 | 58 | * The CSRF data |
60 | 59 | * @var array<string, string> |
@@ -51,8 +51,7 @@ |
||
51 | 51 | * @class CsrfUserSessionStorage |
52 | 52 | * @package Platine\Framework\Security\Csrf\Storage |
53 | 53 | */ |
54 | -class CsrfUserSessionStorage extends CsrfSessionStorage |
|
55 | -{ |
|
54 | +class CsrfUserSessionStorage extends CsrfSessionStorage { |
|
56 | 55 | /** |
57 | 56 | * {@inheritdoc} |
58 | 57 | */ |
@@ -51,8 +51,7 @@ |
||
51 | 51 | * @class MaintenanceDriverInterface |
52 | 52 | * @package Platine\Framework\Http\Maintenance |
53 | 53 | */ |
54 | -interface MaintenanceDriverInterface |
|
55 | -{ |
|
54 | +interface MaintenanceDriverInterface { |
|
56 | 55 | /** |
57 | 56 | * Whether the maintenance is active or not |
58 | 57 | * @return bool |