@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | $this->setName('maintenance') |
| 75 | - ->setDescription('Command to manage application maintenance'); |
|
| 75 | + ->setDescription('Command to manage application maintenance'); |
|
| 76 | 76 | |
| 77 | 77 | $this->addArgument('type', 'type of action [up|down|status]', 'status', true, false, function ($val) { |
| 78 | 78 | if (!in_array($val, ['up', 'down', 'status'])) { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | )); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - return $val; |
|
| 85 | + return $val; |
|
| 86 | 86 | }); |
| 87 | 87 | |
| 88 | 88 | $this->addOption( |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $this->setName('maintenance') |
| 75 | 75 | ->setDescription('Command to manage application maintenance'); |
| 76 | 76 | |
| 77 | - $this->addArgument('type', 'type of action [up|down|status]', 'status', true, false, function ($val) { |
|
| 77 | + $this->addArgument('type', 'type of action [up|down|status]', 'status', true, false, function($val) { |
|
| 78 | 78 | if (!in_array($val, ['up', 'down', 'status'])) { |
| 79 | 79 | throw new RuntimeException(sprintf( |
| 80 | 80 | 'Invalid argument type [%s], must be one of [up, down, status]', |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | 3600, |
| 99 | 99 | false, |
| 100 | 100 | false, |
| 101 | - function ($val) { |
|
| 101 | + function($val) { |
|
| 102 | 102 | if (strlen($val) > 0 && (!is_numeric($val) || (int) $val <= 0)) { |
| 103 | 103 | throw new RuntimeException(sprintf( |
| 104 | 104 | 'Invalid retry value [%s], must be an integer greather than zero', |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | 3600, |
| 116 | 116 | false, |
| 117 | 117 | false, |
| 118 | - function ($val) { |
|
| 118 | + function($val) { |
|
| 119 | 119 | if (strlen($val) > 0 && (!is_numeric($val) || (int) $val <= 0)) { |
| 120 | 120 | throw new RuntimeException(sprintf( |
| 121 | 121 | 'Invalid refresh value [%s], must be an integer greather than zero', |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | 503, |
| 140 | 140 | false, |
| 141 | 141 | false, |
| 142 | - function ($val) { |
|
| 142 | + function($val) { |
|
| 143 | 143 | if (strlen($val) > 0 && (!is_numeric($val) || (int) $val < 200 || (int) $val > 505)) { |
| 144 | 144 | throw new RuntimeException(sprintf( |
| 145 | 145 | 'Invalid HTTP status value [%s], must be between 200 and 505', |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | * @package Platine\Framework\Console\Command |
| 59 | 59 | * @template T |
| 60 | 60 | */ |
| 61 | -class MaintenanceCommand extends Command |
|
| 62 | -{ |
|
| 61 | +class MaintenanceCommand extends Command { |
|
| 63 | 62 | /** |
| 64 | 63 | * Create new instance |
| 65 | 64 | * @param Application $application |
@@ -56,14 +56,12 @@ |
||
| 56 | 56 | * @package Platine\Framework\Console\Command |
| 57 | 57 | * @template T |
| 58 | 58 | */ |
| 59 | -class ConfigCommand extends Command |
|
| 60 | -{ |
|
| 59 | +class ConfigCommand extends Command { |
|
| 61 | 60 | /** |
| 62 | 61 | * Create new instance |
| 63 | 62 | * @param Config<T> $config |
| 64 | 63 | */ |
| 65 | - public function __construct(protected Config $config) |
|
| 66 | - { |
|
| 64 | + public function __construct(protected Config $config) { |
|
| 67 | 65 | parent::__construct('config', 'Command to manage configuration'); |
| 68 | 66 | |
| 69 | 67 | $this->addOption('-l|--list', 'List the configuration', '', false); |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | * @package Platine\Framework\Console\Command |
| 62 | 62 | * @template T |
| 63 | 63 | */ |
| 64 | -class RouteCommand extends Command |
|
| 65 | -{ |
|
| 64 | +class RouteCommand extends Command { |
|
| 66 | 65 | /** |
| 67 | 66 | * Create new instance |
| 68 | 67 | * @param Application $application |
@@ -56,8 +56,7 @@ |
||
| 56 | 56 | * @class MakeCommand |
| 57 | 57 | * @package Platine\Framework\Console |
| 58 | 58 | */ |
| 59 | -abstract class MakeCommand extends BaseCommand |
|
| 60 | -{ |
|
| 59 | +abstract class MakeCommand extends BaseCommand { |
|
| 61 | 60 | /** |
| 62 | 61 | * The type of class |
| 63 | 62 | * @var string |
@@ -53,14 +53,12 @@ |
||
| 53 | 53 | * @class BaseKernel |
| 54 | 54 | * @package Platine\Framework\Kernel |
| 55 | 55 | */ |
| 56 | -class BaseKernel |
|
| 57 | -{ |
|
| 56 | +class BaseKernel { |
|
| 58 | 57 | /** |
| 59 | 58 | * Create new instance |
| 60 | 59 | * @param Application $app |
| 61 | 60 | */ |
| 62 | - public function __construct(protected Application $app) |
|
| 63 | - { |
|
| 61 | + public function __construct(protected Application $app) { |
|
| 64 | 62 | } |
| 65 | 63 | |
| 66 | 64 | /** |
@@ -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 |
@@ -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); |
@@ -187,15 +187,15 @@ |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | $data = [ |
| 190 | - 'user' => [ |
|
| 190 | + 'user' => [ |
|
| 191 | 191 | 'id' => $user->id, |
| 192 | 192 | 'username' => $user->username, |
| 193 | 193 | 'lastname' => $user->lastname, |
| 194 | 194 | 'firstname' => $user->firstname, |
| 195 | 195 | 'email' => $user->email, |
| 196 | 196 | 'status' => $user->status, |
| 197 | - ], |
|
| 198 | - 'permissions' => $permissions, |
|
| 197 | + ], |
|
| 198 | + 'permissions' => $permissions, |
|
| 199 | 199 | ]; |
| 200 | 200 | |
| 201 | 201 | $loginData = array_merge($data, $this->getUserData($user)); |
@@ -54,14 +54,12 @@ |
||
| 54 | 54 | * @class AuthLoginEvent |
| 55 | 55 | * @package Platine\Framework\Auth\Event |
| 56 | 56 | */ |
| 57 | -class AuthLoginEvent extends Event |
|
| 58 | -{ |
|
| 57 | +class AuthLoginEvent extends Event { |
|
| 59 | 58 | /** |
| 60 | 59 | * Create new instance |
| 61 | 60 | * @param User $user |
| 62 | 61 | */ |
| 63 | - public function __construct(protected User $user) |
|
| 64 | - { |
|
| 62 | + public function __construct(protected User $user) { |
|
| 65 | 63 | parent::__construct(__CLASS__, []); |
| 66 | 64 | } |
| 67 | 65 | |
@@ -54,14 +54,12 @@ |
||
| 54 | 54 | * @class AuthInvalidPasswordEvent |
| 55 | 55 | * @package Platine\Framework\Auth\Event |
| 56 | 56 | */ |
| 57 | -class AuthInvalidPasswordEvent extends Event |
|
| 58 | -{ |
|
| 57 | +class AuthInvalidPasswordEvent extends Event { |
|
| 59 | 58 | /** |
| 60 | 59 | * Create new instance |
| 61 | 60 | * @param User $user |
| 62 | 61 | */ |
| 63 | - public function __construct(protected User $user) |
|
| 64 | - { |
|
| 62 | + public function __construct(protected User $user) { |
|
| 65 | 63 | parent::__construct(__CLASS__, []); |
| 66 | 64 | } |
| 67 | 65 | |
@@ -62,8 +62,7 @@ |
||
| 62 | 62 | * @package Platine\Framework\Auth\Middleware |
| 63 | 63 | * @template T |
| 64 | 64 | */ |
| 65 | -class AuthorizationMiddleware implements MiddlewareInterface |
|
| 66 | -{ |
|
| 65 | +class AuthorizationMiddleware implements MiddlewareInterface { |
|
| 67 | 66 | /** |
| 68 | 67 | * Create new instance |
| 69 | 68 | * @param AuthorizationInterface $authorization |