Passed
Push — develop ( a52f7d...7316b8 )
by nguereza
05:38 queued 01:59
created
src/Http/Action/CrudAction.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
src/Http/RateLimit/Storage/SessionStorage.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,9 +64,9 @@
 block discarded – undo
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, [
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,14 +54,12 @@
 block discarded – undo
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
      /**
Please login to merge, or discard this patch.
src/Http/RateLimit/RateLimit.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Http/Maintenance/Driver/FileMaintenanceDriver.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Config/DatabaseConfigLoader.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -124,13 +124,13 @@
 block discarded – undo
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 */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
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
                                   });
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,14 +56,12 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Config/ConfigUtil.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Helper/functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
         string $key,
78 78
         mixed $default = null,
79 79
         ?string $filter = null,
80
-        int|array $options = 0
80
+        int | array $options = 0
81 81
     ): mixed {
82 82
         return Env::get($key, $default, $filter, $options);
83 83
     }
Please login to merge, or discard this patch.
src/Helper/Mermaid/Graph/Link.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 {
58 58
     /**
59 59
      * Constants
60
-    */
60
+     */
61 61
     public const ARROW  = 1;
62 62
     public const LINE   = 2;
63 63
     public const DOTTED = 3;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
  * @class Link
54 54
  * @package Platine\Framework\Helper\Mermaid\Graph
55 55
  */
56
-class Link implements Stringable
57
-{
56
+class Link implements Stringable {
58 57
     /**
59 58
      * Constants
60 59
     */
Please login to merge, or discard this patch.
src/Helper/Mermaid/Graph/Graph.php 2 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -55,67 +55,67 @@  discard block
 block discarded – undo
55 55
  */
56 56
 class Graph implements Stringable
57 57
 {
58
-   /**
59
-    * Constants
60
-   */
58
+    /**
59
+     * Constants
60
+     */
61 61
     public const TOP_BOTTOM = 'TB';
62 62
     public const BOTTOM_TOP = 'BT';
63 63
     public const LEFT_RIGHT = 'LR';
64 64
     public const RIGHT_LEFT = 'RL';
65 65
 
66
-   /**
67
-    * Space for each sub graph
68
-    */
66
+    /**
67
+     * Space for each sub graph
68
+     */
69 69
     private const RENDER_SHIFT = 4;
70 70
 
71
-   /**
72
-    * The list of sub graph
73
-    * @var array<Graph>
74
-    */
71
+    /**
72
+     * The list of sub graph
73
+     * @var array<Graph>
74
+     */
75 75
     protected array $subGraphs = [];
76 76
 
77
-   /**
78
-    * The list of nodes
79
-    * @var array<string, Node>
80
-    */
77
+    /**
78
+     * The list of nodes
79
+     * @var array<string, Node>
80
+     */
81 81
     protected array $nodes = [];
82 82
 
83
-   /**
84
-    * The list of links
85
-    * @var array<Link>
86
-    */
83
+    /**
84
+     * The list of links
85
+     * @var array<Link>
86
+     */
87 87
     protected array $links = [];
88 88
 
89
-   /**
90
-    * The graph parameter
91
-    * @var array<string, mixed>
92
-    */
89
+    /**
90
+     * The graph parameter
91
+     * @var array<string, mixed>
92
+     */
93 93
     protected array $params = [
94
-       'title' => 'Graph',
95
-       'direction' => self::LEFT_RIGHT,
94
+        'title' => 'Graph',
95
+        'direction' => self::LEFT_RIGHT,
96 96
     ];
97 97
 
98
-   /**
99
-    * Style list
100
-    * @var array<string>
101
-    */
98
+    /**
99
+     * Style list
100
+     * @var array<string>
101
+     */
102 102
     protected array $styles = [];
103 103
 
104
-   /**
105
-    * Create new instance
106
-    * @param array<string, mixed> $params
107
-    */
104
+    /**
105
+     * Create new instance
106
+     * @param array<string, mixed> $params
107
+     */
108 108
     public function __construct(array $params = [])
109 109
     {
110 110
         $this->setParams($params);
111 111
     }
112 112
 
113
-   /**
114
-    * Render the graph to string representation
115
-    * @param bool $isMainGraph
116
-    * @param int $shift
117
-    * @return string
118
-    */
113
+    /**
114
+     * Render the graph to string representation
115
+     * @param bool $isMainGraph
116
+     * @param int $shift
117
+     * @return string
118
+     */
119 119
     public function render(bool $isMainGraph = true, int $shift = 0): string
120 120
     {
121 121
         $spaces = str_repeat(' ', $shift);
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
         return implode(PHP_EOL, $result);
172 172
     }
173 173
 
174
-   /**
175
-    * Add new node
176
-    * @param Node $node
177
-    * @return $this
178
-    */
174
+    /**
175
+     * Add new node
176
+     * @param Node $node
177
+     * @return $this
178
+     */
179 179
     public function addNode(Node $node): self
180 180
     {
181 181
         $this->nodes[$node->getId()] = $node;
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
         return $this;
184 184
     }
185 185
 
186
-   /**
187
-    * Add new link
188
-    * @param Link $link
189
-    * @return $this
190
-    */
186
+    /**
187
+     * Add new link
188
+     * @param Link $link
189
+     * @return $this
190
+     */
191 191
     public function addLink(Link $link): self
192 192
     {
193 193
         $this->links[] = $link;
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
         return $this;
196 196
     }
197 197
 
198
-   /**
199
-    * Add new style
200
-    * @param string $style
201
-    * @return $this
202
-    */
198
+    /**
199
+     * Add new style
200
+     * @param string $style
201
+     * @return $this
202
+     */
203 203
     public function addStyle(string $style): self
204 204
     {
205 205
         $this->styles[] = $style;
@@ -207,11 +207,11 @@  discard block
 block discarded – undo
207 207
         return $this;
208 208
     }
209 209
 
210
-   /**
211
-    * Add new sub graph
212
-    * @param Graph $subGraph
213
-    * @return $this
214
-    */
210
+    /**
211
+     * Add new sub graph
212
+     * @param Graph $subGraph
213
+     * @return $this
214
+     */
215 215
     public function addSubGraph(Graph $subGraph): self
216 216
     {
217 217
         $this->subGraphs[] = $subGraph;
@@ -219,67 +219,67 @@  discard block
 block discarded – undo
219 219
         return $this;
220 220
     }
221 221
 
222
-   /**
223
-    * Return the string representation
224
-    * @return string
225
-    */
222
+    /**
223
+     * Return the string representation
224
+     * @return string
225
+     */
226 226
     public function __toString(): string
227 227
     {
228 228
         return $this->render();
229 229
     }
230 230
 
231 231
 
232
-   /**
233
-    * Return the parameters
234
-    * @return array<string, mixed>
235
-    */
232
+    /**
233
+     * Return the parameters
234
+     * @return array<string, mixed>
235
+     */
236 236
     public function getParams(): array
237 237
     {
238 238
         return $this->params;
239 239
     }
240 240
 
241
-   /**
242
-    * Set the parameters
243
-    * @param array<string, mixed> $params
244
-    * @return $this
245
-    */
241
+    /**
242
+     * Set the parameters
243
+     * @param array<string, mixed> $params
244
+     * @return $this
245
+     */
246 246
     public function setParams(array $params)
247 247
     {
248 248
         $this->params = array_merge($this->params, $params);
249 249
         return $this;
250 250
     }
251 251
 
252
-   /**
253
-    * Return the list of sub graph
254
-    * @return array<Graph>
255
-    */
252
+    /**
253
+     * Return the list of sub graph
254
+     * @return array<Graph>
255
+     */
256 256
     public function getSubGraphs(): array
257 257
     {
258 258
         return $this->subGraphs;
259 259
     }
260 260
 
261
-   /**
262
-    * Return the list of node
263
-    * @return array<string, Node>
264
-    */
261
+    /**
262
+     * Return the list of node
263
+     * @return array<string, Node>
264
+     */
265 265
     public function getNodes(): array
266 266
     {
267 267
         return $this->nodes;
268 268
     }
269 269
 
270
-   /**
271
-    * Return the list of link
272
-    * @return array<Link>
273
-    */
270
+    /**
271
+     * Return the list of link
272
+     * @return array<Link>
273
+     */
274 274
     public function getLinks(): array
275 275
     {
276 276
         return $this->links;
277 277
     }
278 278
 
279
-   /**
280
-    * Return the list of style
281
-    * @return array<string>
282
-    */
279
+    /**
280
+     * Return the list of style
281
+     * @return array<string>
282
+     */
283 283
     public function getStyles(): array
284 284
     {
285 285
         return $this->styles;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * @class Graph
54 54
  * @package Platine\Framework\Helper\Mermaid\Graph
55 55
  */
56
-class Graph implements Stringable
57
-{
56
+class Graph implements Stringable {
58 57
    /**
59 58
     * Constants
60 59
    */
@@ -105,8 +104,7 @@  discard block
 block discarded – undo
105 104
     * Create new instance
106 105
     * @param array<string, mixed> $params
107 106
     */
108
-    public function __construct(array $params = [])
109
-    {
107
+    public function __construct(array $params = []) {
110 108
         $this->setParams($params);
111 109
     }
112 110
 
@@ -243,8 +241,7 @@  discard block
 block discarded – undo
243 241
     * @param array<string, mixed> $params
244 242
     * @return $this
245 243
     */
246
-    public function setParams(array $params)
247
-    {
244
+    public function setParams(array $params) {
248 245
         $this->params = array_merge($this->params, $params);
249 246
         return $this;
250 247
     }
Please login to merge, or discard this patch.