@@ -42,8 +42,7 @@ |
||
| 42 | 42 | * @class MailerServiceProvider |
| 43 | 43 | * @package Platine\Framework\Service\Provider |
| 44 | 44 | */ |
| 45 | -class MailerServiceProvider extends ServiceProvider |
|
| 46 | -{ |
|
| 45 | +class MailerServiceProvider extends ServiceProvider { |
|
| 47 | 46 | /** |
| 48 | 47 | * {@inheritdoc} |
| 49 | 48 | */ |
@@ -41,8 +41,7 @@ |
||
| 41 | 41 | * @class MailerMailServiceProvider |
| 42 | 42 | * @package Platine\Framework\Service\Provider |
| 43 | 43 | */ |
| 44 | -class MailerMailServiceProvider extends ServiceProvider |
|
| 45 | -{ |
|
| 44 | +class MailerMailServiceProvider extends ServiceProvider { |
|
| 46 | 45 | /** |
| 47 | 46 | * {@inheritdoc} |
| 48 | 47 | */ |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function register(): void |
| 52 | 52 | { |
| 53 | - $this->app->bind(TransportInterface::class, function (ContainerInterface $app) { |
|
| 53 | + $this->app->bind(TransportInterface::class, function(ContainerInterface $app) { |
|
| 54 | 54 | $smtp = new SMTP( |
| 55 | 55 | $app->get(Config::class)->get('mail.smtp.host', 'localhost'), |
| 56 | 56 | $app->get(Config::class)->get('mail.smtp.port', 25), |
@@ -43,8 +43,7 @@ |
||
| 43 | 43 | * @class MailerSMTPServiceProvider |
| 44 | 44 | * @package Platine\Framework\Service\Provider |
| 45 | 45 | */ |
| 46 | -class MailerSMTPServiceProvider extends ServiceProvider |
|
| 47 | -{ |
|
| 46 | +class MailerSMTPServiceProvider extends ServiceProvider { |
|
| 48 | 47 | /** |
| 49 | 48 | * {@inheritdoc} |
| 50 | 49 | */ |
@@ -37,8 +37,7 @@ |
||
| 37 | 37 | * @class FilterFieldType |
| 38 | 38 | * @package Platine\Framework\Enum |
| 39 | 39 | */ |
| 40 | -class FilterFieldType |
|
| 41 | -{ |
|
| 40 | +class FilterFieldType { |
|
| 42 | 41 | public const TEXT = 'T'; |
| 43 | 42 | public const SELECT = 'S'; |
| 44 | 43 | public const DATE = 'D'; |
@@ -37,8 +37,7 @@ |
||
| 37 | 37 | * @class YesNoStatus |
| 38 | 38 | * @package Platine\Framework\Enum |
| 39 | 39 | */ |
| 40 | -class YesNoStatus |
|
| 41 | -{ |
|
| 40 | +class YesNoStatus { |
|
| 42 | 41 | public const YES = 'Y'; |
| 43 | 42 | public const NO = 'N'; |
| 44 | 43 | } |
@@ -37,8 +37,7 @@ |
||
| 37 | 37 | * @class Gender |
| 38 | 38 | * @package Platine\Framework\Enum |
| 39 | 39 | */ |
| 40 | -class Gender |
|
| 41 | -{ |
|
| 40 | +class Gender { |
|
| 42 | 41 | public const MALE = 'M'; |
| 43 | 42 | public const FEMALE = 'F'; |
| 44 | 43 | } |
@@ -178,10 +178,10 @@ |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
| 181 | - * Create instance using database configuration |
|
| 182 | - * @param AppDatabaseConfig $cfg |
|
| 183 | - * @return $this |
|
| 184 | - */ |
|
| 181 | + * Create instance using database configuration |
|
| 182 | + * @param AppDatabaseConfig $cfg |
|
| 183 | + * @return $this |
|
| 184 | + */ |
|
| 185 | 185 | public function fromConfig(AppDatabaseConfig $cfg): self |
| 186 | 186 | { |
| 187 | 187 | return $this; |
@@ -62,8 +62,7 @@ discard block |
||
| 62 | 62 | * @package Platine\Framework\Form\Param |
| 63 | 63 | * @template TEntity as Entity |
| 64 | 64 | */ |
| 65 | -class BaseParam implements JsonSerializable |
|
| 66 | -{ |
|
| 65 | +class BaseParam implements JsonSerializable { |
|
| 67 | 66 | /** |
| 68 | 67 | * The list of fields to ignore |
| 69 | 68 | * @var array<string> |
@@ -74,8 +73,7 @@ discard block |
||
| 74 | 73 | * Create new instance |
| 75 | 74 | * @param array<string, mixed> $data |
| 76 | 75 | */ |
| 77 | - public function __construct(array $data = []) |
|
| 78 | - { |
|
| 76 | + public function __construct(array $data = []) { |
|
| 79 | 77 | // Load default values |
| 80 | 78 | $this->loadDefaultValues(); |
| 81 | 79 | |
@@ -72,8 +72,7 @@ |
||
| 72 | 72 | * @package Platine\Framework\Auth\Authentication |
| 73 | 73 | * @template T |
| 74 | 74 | */ |
| 75 | -class JWTAuthentication implements AuthenticationInterface |
|
| 76 | -{ |
|
| 75 | +class JWTAuthentication implements AuthenticationInterface { |
|
| 77 | 76 | /** |
| 78 | 77 | * Create new instance |
| 79 | 78 | * @param JWT $jwt |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | /** |
| 109 | 109 | * {@inheritdoc} |
| 110 | 110 | */ |
| 111 | - public function getId(): int|string |
|
| 111 | + public function getId(): int | string |
|
| 112 | 112 | { |
| 113 | 113 | if ($this->isLogged() === false) { |
| 114 | 114 | throw new AccountNotFoundException('User not logged', 401); |
@@ -230,12 +230,12 @@ discard block |
||
| 230 | 230 | $tokenExpire = time() + $expire; |
| 231 | 231 | $refreshTokenExpire = time() + $refreshExpire; |
| 232 | 232 | $this->jwt->setSecret($secret) |
| 233 | - ->setPayload([ |
|
| 234 | - 'sub' => $user->id, |
|
| 235 | - 'exp' => $tokenExpire, |
|
| 236 | - 'permissions' => $permissions, |
|
| 237 | - ]) |
|
| 238 | - ->sign(); |
|
| 233 | + ->setPayload([ |
|
| 234 | + 'sub' => $user->id, |
|
| 235 | + 'exp' => $tokenExpire, |
|
| 236 | + 'permissions' => $permissions, |
|
| 237 | + ]) |
|
| 238 | + ->sign(); |
|
| 239 | 239 | |
| 240 | 240 | $refreshToken = Str::random(64); |
| 241 | 241 | $jwtToken = $this->jwt->getToken(); |
@@ -249,17 +249,17 @@ discard block |
||
| 249 | 249 | $this->tokenRepository->save($token); |
| 250 | 250 | |
| 251 | 251 | $data = [ |
| 252 | - 'user' => [ |
|
| 252 | + 'user' => [ |
|
| 253 | 253 | 'id' => $user->id, |
| 254 | 254 | 'username' => $user->username, |
| 255 | 255 | 'lastname' => $user->lastname, |
| 256 | 256 | 'firstname' => $user->firstname, |
| 257 | 257 | 'email' => $user->email, |
| 258 | 258 | 'status' => $user->status, |
| 259 | - ], |
|
| 260 | - 'permissions' => $permissions, |
|
| 261 | - 'token' => $jwtToken, |
|
| 262 | - 'refresh_token' => $refreshToken, |
|
| 259 | + ], |
|
| 260 | + 'permissions' => $permissions, |
|
| 261 | + 'token' => $jwtToken, |
|
| 262 | + 'refresh_token' => $refreshToken, |
|
| 263 | 263 | ]; |
| 264 | 264 | |
| 265 | 265 | return array_merge($data, $this->getUserData($user, $token)); |
@@ -57,14 +57,12 @@ |
||
| 57 | 57 | * @package Platine\Framework\Auth\Repository |
| 58 | 58 | * @extends Repository<Permission> |
| 59 | 59 | */ |
| 60 | -class PermissionRepository extends Repository |
|
| 61 | -{ |
|
| 60 | +class PermissionRepository extends Repository { |
|
| 62 | 61 | /** |
| 63 | 62 | * Create new instance |
| 64 | 63 | * @param EntityManager<Permission> $manager |
| 65 | 64 | */ |
| 66 | - public function __construct(EntityManager $manager) |
|
| 67 | - { |
|
| 65 | + public function __construct(EntityManager $manager) { |
|
| 68 | 66 | parent::__construct($manager, Permission::class); |
| 69 | 67 | } |
| 70 | 68 | |