@@ -70,8 +70,7 @@ |
||
70 | 70 | * @package Platine\Framework\Http\Middleware |
71 | 71 | * @template T |
72 | 72 | */ |
73 | -class MaintenanceMiddleware implements MiddlewareInterface |
|
74 | -{ |
|
73 | +class MaintenanceMiddleware implements MiddlewareInterface { |
|
75 | 74 | /** |
76 | 75 | * The configuration instance |
77 | 76 | * @var Config<T> |
@@ -138,8 +138,8 @@ |
||
138 | 138 | ); |
139 | 139 | |
140 | 140 | $httpException->setTitle('Service Unavailable') |
141 | - ->setDescription($message) |
|
142 | - ->setHeaders($this->getHeaders($data)); |
|
141 | + ->setDescription($message) |
|
142 | + ->setHeaders($this->getHeaders($data)); |
|
143 | 143 | |
144 | 144 | throw $httpException; |
145 | 145 | } |
@@ -55,6 +55,5 @@ |
||
55 | 55 | * @template TDbConfigurationEntity as \Platine\Orm\Entity |
56 | 56 | * @extends RepositoryInterface<TDbConfigurationEntity> |
57 | 57 | */ |
58 | -interface ConfigurationRepositoryInterface extends RepositoryInterface |
|
59 | -{ |
|
58 | +interface ConfigurationRepositoryInterface extends RepositoryInterface { |
|
60 | 59 | } |
@@ -57,8 +57,7 @@ |
||
57 | 57 | * @class BaseCommand |
58 | 58 | * @package Platine\Framework\Console |
59 | 59 | */ |
60 | -abstract class BaseCommand extends Command |
|
61 | -{ |
|
60 | +abstract class BaseCommand extends Command { |
|
62 | 61 | /** |
63 | 62 | * The Application instance |
64 | 63 | * @var Application |
@@ -56,8 +56,7 @@ discard block |
||
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 |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | /** |
94 | 93 | * {@inheritdoc} |
95 | 94 | */ |
96 | - public function execute() |
|
97 | - { |
|
95 | + public function execute() { |
|
98 | 96 | $io = $this->io(); |
99 | 97 | $writer = $io->writer(); |
100 | 98 | $name = $this->className; |
@@ -142,10 +142,10 @@ |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * Get watch |
|
146 | - * @param string $name |
|
147 | - * @return Timer |
|
148 | - */ |
|
145 | + * Get watch |
|
146 | + * @param string $name |
|
147 | + * @return Timer |
|
148 | + */ |
|
149 | 149 | public function getWatch(string $name): Timer |
150 | 150 | { |
151 | 151 | if (array_key_exists($name, $this->timers) === false) { |
@@ -54,8 +54,7 @@ |
||
54 | 54 | * @class Watch |
55 | 55 | * @package Platine\Framework\Helper\Timer |
56 | 56 | */ |
57 | -class Watch |
|
58 | -{ |
|
57 | +class Watch { |
|
59 | 58 | /** |
60 | 59 | * The default name to use if none is provided |
61 | 60 | */ |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | * @class Timer |
55 | 55 | * @package Platine\Framework\Helper\Timer |
56 | 56 | */ |
57 | -class Timer |
|
58 | -{ |
|
57 | +class Timer { |
|
59 | 58 | public const NOT_STARTED = 0; |
60 | 59 | public const STARTED = 1; |
61 | 60 | public const PAUSED = 2; |
@@ -89,8 +88,7 @@ discard block |
||
89 | 88 | * Create new timer instance |
90 | 89 | * @param string $name |
91 | 90 | */ |
92 | - public function __construct(string $name) |
|
93 | - { |
|
91 | + public function __construct(string $name) { |
|
94 | 92 | $this->name = $name; |
95 | 93 | } |
96 | 94 |
@@ -66,7 +66,7 @@ |
||
66 | 66 | public function register(): void |
67 | 67 | { |
68 | 68 | $this->app->bind(AdapterInterface::class, OpenSSL::class); |
69 | - $this->app->bind(Encryption::class, function (ContainerInterface $app) { |
|
69 | + $this->app->bind(Encryption::class, function(ContainerInterface $app) { |
|
70 | 70 | $e = new Encryption($app->get(AdapterInterface::class)); |
71 | 71 | $e->setSecret($app->get(Config::class)->get('security.encryption.key', '')); |
72 | 72 |
@@ -58,8 +58,7 @@ |
||
58 | 58 | * @class EncryptionServiceProvider |
59 | 59 | * @package Platine\Framework\Service\Provider |
60 | 60 | */ |
61 | -class EncryptionServiceProvider extends ServiceProvider |
|
62 | -{ |
|
61 | +class EncryptionServiceProvider extends ServiceProvider { |
|
63 | 62 | /** |
64 | 63 | * {@inheritdoc} |
65 | 64 | */ |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | * @class ResponseEmitter |
59 | 59 | * @package Platine\Framework\Http\Emitter |
60 | 60 | */ |
61 | -class ResponseEmitter implements EmitterInterface |
|
62 | -{ |
|
61 | +class ResponseEmitter implements EmitterInterface { |
|
63 | 62 | /** |
64 | 63 | * The response buffer length |
65 | 64 | * @var int|null |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | * Create new instance |
71 | 70 | * @param int|null $bufferLength |
72 | 71 | */ |
73 | - public function __construct(?int $bufferLength = null) |
|
74 | - { |
|
72 | + public function __construct(?int $bufferLength = null) { |
|
75 | 73 | if ($bufferLength !== null && $bufferLength < 1) { |
76 | 74 | throw new InvalidArgumentException(sprintf( |
77 | 75 | 'The response buffer length must be greater than zero; received [%d].', |
@@ -71,45 +71,45 @@ discard block |
||
71 | 71 | class CrudAction |
72 | 72 | { |
73 | 73 | /** |
74 | - * The Lang instance |
|
75 | - * @var Lang |
|
76 | - */ |
|
74 | + * The Lang instance |
|
75 | + * @var Lang |
|
76 | + */ |
|
77 | 77 | protected Lang $lang; |
78 | 78 | |
79 | 79 | /** |
80 | - * The Pagination instance |
|
81 | - * @var Pagination |
|
82 | - */ |
|
80 | + * The Pagination instance |
|
81 | + * @var Pagination |
|
82 | + */ |
|
83 | 83 | protected Pagination $pagination; |
84 | 84 | |
85 | 85 | /** |
86 | - * The Template instance |
|
87 | - * @var Template |
|
88 | - */ |
|
86 | + * The Template instance |
|
87 | + * @var Template |
|
88 | + */ |
|
89 | 89 | protected Template $template; |
90 | 90 | |
91 | 91 | /** |
92 | - * The Flash instance |
|
93 | - * @var Flash |
|
94 | - */ |
|
92 | + * The Flash instance |
|
93 | + * @var Flash |
|
94 | + */ |
|
95 | 95 | protected Flash $flash; |
96 | 96 | |
97 | 97 | /** |
98 | - * The RouteHelper instance |
|
99 | - * @var RouteHelper |
|
100 | - */ |
|
98 | + * The RouteHelper instance |
|
99 | + * @var RouteHelper |
|
100 | + */ |
|
101 | 101 | protected RouteHelper $routeHelper; |
102 | 102 | |
103 | 103 | /** |
104 | - * The LoggerInterface instance |
|
105 | - * @var LoggerInterface |
|
106 | - */ |
|
104 | + * The LoggerInterface instance |
|
105 | + * @var LoggerInterface |
|
106 | + */ |
|
107 | 107 | protected LoggerInterface $logger; |
108 | 108 | |
109 | 109 | /** |
110 | - * The Repository instance |
|
111 | - * @var Repository<TEntity> |
|
112 | - */ |
|
110 | + * The Repository instance |
|
111 | + * @var Repository<TEntity> |
|
112 | + */ |
|
113 | 113 | protected Repository $repository; |
114 | 114 | |
115 | 115 | /** |
@@ -197,14 +197,14 @@ discard block |
||
197 | 197 | protected string $validatorClass; |
198 | 198 | |
199 | 199 | /** |
200 | - * Create new instance |
|
201 | - * @param Lang $lang |
|
202 | - * @param Pagination $pagination |
|
203 | - * @param Template $template |
|
204 | - * @param Flash $flash |
|
205 | - * @param RouteHelper $routeHelper |
|
206 | - * @param LoggerInterface $logger |
|
207 | - */ |
|
200 | + * Create new instance |
|
201 | + * @param Lang $lang |
|
202 | + * @param Pagination $pagination |
|
203 | + * @param Template $template |
|
204 | + * @param Flash $flash |
|
205 | + * @param RouteHelper $routeHelper |
|
206 | + * @param LoggerInterface $logger |
|
207 | + */ |
|
208 | 208 | public function __construct( |
209 | 209 | Lang $lang, |
210 | 210 | Pagination $pagination, |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
225 | - * List all entities |
|
226 | - * @param ServerRequestInterface $request |
|
227 | - * @return ResponseInterface |
|
228 | - */ |
|
225 | + * List all entities |
|
226 | + * @param ServerRequestInterface $request |
|
227 | + * @return ResponseInterface |
|
228 | + */ |
|
229 | 229 | public function index(ServerRequestInterface $request): ResponseInterface |
230 | 230 | { |
231 | 231 | $context = $this->getTemplateData(); |
@@ -237,14 +237,14 @@ discard block |
||
237 | 237 | $currentPage = (int) $param->get('page', 1); |
238 | 238 | |
239 | 239 | $this->pagination->setTotalItems($totalItems) |
240 | - ->setCurrentPage($currentPage); |
|
240 | + ->setCurrentPage($currentPage); |
|
241 | 241 | |
242 | 242 | $limit = $this->pagination->getItemsPerPage(); |
243 | 243 | $offset = $this->pagination->getOffset(); |
244 | 244 | |
245 | 245 | $query = $this->repository->query(); |
246 | 246 | $query->offset($offset) |
247 | - ->limit($limit); |
|
247 | + ->limit($limit); |
|
248 | 248 | |
249 | 249 | if (count($this->orderFields) > 0) { |
250 | 250 | foreach ($this->orderFields as $field => $dir) { |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
273 | - * List entity detail |
|
274 | - * @param ServerRequestInterface $request |
|
275 | - * @return ResponseInterface |
|
276 | - */ |
|
273 | + * List entity detail |
|
274 | + * @param ServerRequestInterface $request |
|
275 | + * @return ResponseInterface |
|
276 | + */ |
|
277 | 277 | public function detail(ServerRequestInterface $request): ResponseInterface |
278 | 278 | { |
279 | 279 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -301,10 +301,10 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
304 | - * Create new entity |
|
305 | - * @param ServerRequestInterface $request |
|
306 | - * @return ResponseInterface |
|
307 | - */ |
|
304 | + * Create new entity |
|
305 | + * @param ServerRequestInterface $request |
|
306 | + * @return ResponseInterface |
|
307 | + */ |
|
308 | 308 | public function create(ServerRequestInterface $request): ResponseInterface |
309 | 309 | { |
310 | 310 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -378,10 +378,10 @@ discard block |
||
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
381 | - * Update existing entity |
|
382 | - * @param ServerRequestInterface $request |
|
383 | - * @return ResponseInterface |
|
384 | - */ |
|
381 | + * Update existing entity |
|
382 | + * @param ServerRequestInterface $request |
|
383 | + * @return ResponseInterface |
|
384 | + */ |
|
385 | 385 | public function update(ServerRequestInterface $request): ResponseInterface |
386 | 386 | { |
387 | 387 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -467,10 +467,10 @@ discard block |
||
467 | 467 | } |
468 | 468 | |
469 | 469 | /** |
470 | - * Delete the entity |
|
471 | - * @param ServerRequestInterface $request |
|
472 | - * @return ResponseInterface |
|
473 | - */ |
|
470 | + * Delete the entity |
|
471 | + * @param ServerRequestInterface $request |
|
472 | + * @return ResponseInterface |
|
473 | + */ |
|
474 | 474 | public function delete(ServerRequestInterface $request): ResponseInterface |
475 | 475 | { |
476 | 476 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -68,8 +68,7 @@ |
||
68 | 68 | * @package Platine\Framework\Http\Action |
69 | 69 | * @template TEntity as \Platine\Orm\Entity |
70 | 70 | */ |
71 | -class CrudAction |
|
72 | -{ |
|
71 | +class CrudAction { |
|
73 | 72 | /** |
74 | 73 | * The Lang instance |
75 | 74 | * @var Lang |