@@ -123,7 +123,7 @@ |
||
123 | 123 | */ |
124 | 124 | protected function shouldBeProcessed(ServerRequestInterface $request): bool |
125 | 125 | { |
126 | - //If no route has been match no need check for CSRF |
|
126 | + //If no route has been match no need check for CSRF |
|
127 | 127 | /** @var Route|null $route */ |
128 | 128 | $route = $request->getAttribute(Route::class); |
129 | 129 | if ($route === null) { |
@@ -64,8 +64,7 @@ |
||
64 | 64 | * @package Platine\Framework\Http\Middleware |
65 | 65 | * @template T |
66 | 66 | */ |
67 | -class CsrfMiddleware implements MiddlewareInterface |
|
68 | -{ |
|
67 | +class CsrfMiddleware implements MiddlewareInterface { |
|
69 | 68 | /** |
70 | 69 | * The request instance to use |
71 | 70 | * @var ServerRequestInterface |
@@ -59,14 +59,12 @@ |
||
59 | 59 | * @package Platine\Framework\Http\Middleware |
60 | 60 | * @template T |
61 | 61 | */ |
62 | -class SecurityPolicyMiddleware implements MiddlewareInterface |
|
63 | -{ |
|
62 | +class SecurityPolicyMiddleware implements MiddlewareInterface { |
|
64 | 63 | /** |
65 | 64 | * Create new instance |
66 | 65 | * @param SecurityPolicy<T> $securityPolicy |
67 | 66 | */ |
68 | - public function __construct(protected SecurityPolicy $securityPolicy) |
|
69 | - { |
|
67 | + public function __construct(protected SecurityPolicy $securityPolicy) { |
|
70 | 68 | } |
71 | 69 | |
72 | 70 | /** |
@@ -123,7 +123,7 @@ |
||
123 | 123 | */ |
124 | 124 | protected function shouldBeProcessed(ServerRequestInterface $request): bool |
125 | 125 | { |
126 | - //If no route has been match no need check for CSRF |
|
126 | + //If no route has been match no need check for CSRF |
|
127 | 127 | /** @var Route|null $route */ |
128 | 128 | $route = $request->getAttribute(Route::class); |
129 | 129 | if ($route === null) { |
@@ -59,14 +59,12 @@ |
||
59 | 59 | * @class RouteDispatcherMiddleware |
60 | 60 | * @package Platine\Framework\Http\Middleware |
61 | 61 | */ |
62 | -class RouteDispatcherMiddleware implements MiddlewareInterface |
|
63 | -{ |
|
62 | +class RouteDispatcherMiddleware implements MiddlewareInterface { |
|
64 | 63 | /** |
65 | 64 | * Create new instance |
66 | 65 | * @param MiddlewareResolverInterface $resolver |
67 | 66 | */ |
68 | - public function __construct(protected MiddlewareResolverInterface $resolver) |
|
69 | - { |
|
67 | + public function __construct(protected MiddlewareResolverInterface $resolver) { |
|
70 | 68 | } |
71 | 69 | |
72 | 70 | /** |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | class CrudAction |
72 | 72 | { |
73 | 73 | /** |
74 | - * The Repository instance |
|
75 | - * @var Repository<TEntity> |
|
76 | - */ |
|
74 | + * The Repository instance |
|
75 | + * @var Repository<TEntity> |
|
76 | + */ |
|
77 | 77 | protected Repository $repository; |
78 | 78 | |
79 | 79 | /** |
@@ -161,14 +161,14 @@ discard block |
||
161 | 161 | protected string $validatorClass; |
162 | 162 | |
163 | 163 | /** |
164 | - * Create new instance |
|
165 | - * @param Lang $lang |
|
166 | - * @param Pagination $pagination |
|
167 | - * @param Template $template |
|
168 | - * @param Flash $flash |
|
169 | - * @param RouteHelper $routeHelper |
|
170 | - * @param LoggerInterface $logger |
|
171 | - */ |
|
164 | + * Create new instance |
|
165 | + * @param Lang $lang |
|
166 | + * @param Pagination $pagination |
|
167 | + * @param Template $template |
|
168 | + * @param Flash $flash |
|
169 | + * @param RouteHelper $routeHelper |
|
170 | + * @param LoggerInterface $logger |
|
171 | + */ |
|
172 | 172 | public function __construct( |
173 | 173 | protected Lang $lang, |
174 | 174 | protected Pagination $pagination, |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
183 | - * List all entities |
|
184 | - * @param ServerRequestInterface $request |
|
185 | - * @return ResponseInterface |
|
186 | - */ |
|
183 | + * List all entities |
|
184 | + * @param ServerRequestInterface $request |
|
185 | + * @return ResponseInterface |
|
186 | + */ |
|
187 | 187 | public function index(ServerRequestInterface $request): ResponseInterface |
188 | 188 | { |
189 | 189 | $context = $this->getTemplateData(); |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | $currentPage = (int) $param->get('page', 1); |
196 | 196 | |
197 | 197 | $this->pagination->setTotalItems($totalItems) |
198 | - ->setCurrentPage($currentPage); |
|
198 | + ->setCurrentPage($currentPage); |
|
199 | 199 | |
200 | 200 | $limit = $this->pagination->getItemsPerPage(); |
201 | 201 | $offset = $this->pagination->getOffset(); |
202 | 202 | |
203 | 203 | $query = $this->repository->query(); |
204 | 204 | $query->offset($offset) |
205 | - ->limit($limit); |
|
205 | + ->limit($limit); |
|
206 | 206 | |
207 | 207 | if (count($this->orderFields) > 0) { |
208 | 208 | foreach ($this->orderFields as $field => $dir) { |
@@ -227,10 +227,10 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
230 | - * List entity detail |
|
231 | - * @param ServerRequestInterface $request |
|
232 | - * @return ResponseInterface |
|
233 | - */ |
|
230 | + * List entity detail |
|
231 | + * @param ServerRequestInterface $request |
|
232 | + * @return ResponseInterface |
|
233 | + */ |
|
234 | 234 | public function detail(ServerRequestInterface $request): ResponseInterface |
235 | 235 | { |
236 | 236 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -258,10 +258,10 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
261 | - * Create new entity |
|
262 | - * @param ServerRequestInterface $request |
|
263 | - * @return ResponseInterface |
|
264 | - */ |
|
261 | + * Create new entity |
|
262 | + * @param ServerRequestInterface $request |
|
263 | + * @return ResponseInterface |
|
264 | + */ |
|
265 | 265 | public function create(ServerRequestInterface $request): ResponseInterface |
266 | 266 | { |
267 | 267 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -334,10 +334,10 @@ discard block |
||
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
337 | - * Update existing entity |
|
338 | - * @param ServerRequestInterface $request |
|
339 | - * @return ResponseInterface |
|
340 | - */ |
|
337 | + * Update existing entity |
|
338 | + * @param ServerRequestInterface $request |
|
339 | + * @return ResponseInterface |
|
340 | + */ |
|
341 | 341 | public function update(ServerRequestInterface $request): ResponseInterface |
342 | 342 | { |
343 | 343 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -422,10 +422,10 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
425 | - * Delete the entity |
|
426 | - * @param ServerRequestInterface $request |
|
427 | - * @return ResponseInterface |
|
428 | - */ |
|
425 | + * Delete the entity |
|
426 | + * @param ServerRequestInterface $request |
|
427 | + * @return ResponseInterface |
|
428 | + */ |
|
429 | 429 | public function delete(ServerRequestInterface $request): ResponseInterface |
430 | 430 | { |
431 | 431 | $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 Repository instance |
75 | 74 | * @var Repository<TEntity> |
@@ -64,9 +64,9 @@ |
||
64 | 64 | { |
65 | 65 | } |
66 | 66 | |
67 | - /** |
|
68 | - * {@inheritdoc} |
|
69 | - */ |
|
67 | + /** |
|
68 | + * {@inheritdoc} |
|
69 | + */ |
|
70 | 70 | public function set(string $key, float $value, int $ttl): bool |
71 | 71 | { |
72 | 72 | $this->session->set($key, [ |
@@ -54,14 +54,12 @@ |
||
54 | 54 | * @class SessionStorage |
55 | 55 | * @package Platine\Framework\Http\RateLimit\Storage |
56 | 56 | */ |
57 | -class SessionStorage implements RateLimitStorageInterface |
|
58 | -{ |
|
57 | +class SessionStorage implements RateLimitStorageInterface { |
|
59 | 58 | /** |
60 | 59 | * Create new instance |
61 | 60 | * @param Session $session |
62 | 61 | */ |
63 | - public function __construct(protected Session $session) |
|
64 | - { |
|
62 | + public function __construct(protected Session $session) { |
|
65 | 63 | } |
66 | 64 | |
67 | 65 | /** |
@@ -54,8 +54,7 @@ |
||
54 | 54 | * @class RateLimit |
55 | 55 | * @package Platine\Framework\Http\RateLimit |
56 | 56 | */ |
57 | -class RateLimit |
|
58 | -{ |
|
57 | +class RateLimit { |
|
59 | 58 | /** |
60 | 59 | * Create new instance |
61 | 60 | * @param RateLimitStorageInterface $storage |
@@ -56,8 +56,7 @@ |
||
56 | 56 | * @package Platine\Framework\Http\Maintenance\Driver |
57 | 57 | * @template T |
58 | 58 | */ |
59 | -class FileMaintenanceDriver implements MaintenanceDriverInterface |
|
60 | -{ |
|
59 | +class FileMaintenanceDriver implements MaintenanceDriverInterface { |
|
61 | 60 | /** |
62 | 61 | * Create new instance |
63 | 62 | * @param Config<T> $config |
@@ -124,13 +124,13 @@ |
||
124 | 124 | ): array { |
125 | 125 | // @codeCoverageIgnoreStart |
126 | 126 | $query = $this->repository->filters($filters) |
127 | - ->query() |
|
128 | - ->where('module')->is($group) |
|
129 | - ->where('status')->is('Y') |
|
130 | - ->where(function (WhereStatement $where) use ($env) { |
|
127 | + ->query() |
|
128 | + ->where('module')->is($group) |
|
129 | + ->where('status')->is('Y') |
|
130 | + ->where(function (WhereStatement $where) use ($env) { |
|
131 | 131 | $where->where('env')->is($env) |
132 | 132 | ->orWhere('env')->isNull(); |
133 | - }); |
|
133 | + }); |
|
134 | 134 | // @codeCoverageIgnoreEnd |
135 | 135 | |
136 | 136 | /** @var Configuration[] $results */ |
@@ -127,7 +127,7 @@ |
||
127 | 127 | ->query() |
128 | 128 | ->where('module')->is($group) |
129 | 129 | ->where('status')->is('Y') |
130 | - ->where(function (WhereStatement $where) use ($env) { |
|
130 | + ->where(function(WhereStatement $where) use ($env) { |
|
131 | 131 | $where->where('env')->is($env) |
132 | 132 | ->orWhere('env')->isNull(); |
133 | 133 | }); |
@@ -56,14 +56,12 @@ |
||
56 | 56 | * @package Platine\Framework\Config |
57 | 57 | * @implements DatabaseConfigLoaderInterface<Configuration> |
58 | 58 | */ |
59 | -class DatabaseConfigLoader implements DatabaseConfigLoaderInterface |
|
60 | -{ |
|
59 | +class DatabaseConfigLoader implements DatabaseConfigLoaderInterface { |
|
61 | 60 | /** |
62 | 61 | * Create new instance |
63 | 62 | * @param ConfigurationRepositoryInterface<Configuration> $repository |
64 | 63 | */ |
65 | - public function __construct(protected ConfigurationRepositoryInterface $repository) |
|
66 | - { |
|
64 | + public function __construct(protected ConfigurationRepositoryInterface $repository) { |
|
67 | 65 | } |
68 | 66 | |
69 | 67 | /** |
@@ -51,8 +51,7 @@ |
||
51 | 51 | * @class ConfigUtil |
52 | 52 | * @package Platine\Framework\Config |
53 | 53 | */ |
54 | -class ConfigUtil |
|
55 | -{ |
|
54 | +class ConfigUtil { |
|
56 | 55 | /** |
57 | 56 | * Convert the returned configuration to given type |
58 | 57 | * @param mixed $value |