Completed
Push — master ( a62a3e...f12ef6 )
by Mathieu
06:15
created
src/Charcoal/Cms/Service/Loader/NewsLoader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $now = new DateTime();
49 49
         $loader = $this->all();
50
-        $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ])
51
-            ->addFilter('expiry_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '>=' ]);
50
+        $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), ['operator' => '<='])
51
+            ->addFilter('expiry_date', $now->format('Y-m-d H:i:s'), ['operator' => '>=']);
52 52
 
53 53
         return $loader;
54 54
     }
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $now = new DateTime();
62 62
         $loader = $this->all();
63
-        $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ])
64
-            ->addFilter('expiry_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]);
63
+        $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), ['operator' => '<='])
64
+            ->addFilter('expiry_date', $now->format('Y-m-d H:i:s'), ['operator' => '<=']);
65 65
 
66 66
         return $loader;
67 67
     }
Please login to merge, or discard this patch.
src/Charcoal/Cms/Service/Manager/EventManager.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         }
217 217
 
218 218
         if ($this->category()) {
219
-            $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]);
219
+            $loader->addFilter('category', $this->category(), ['operator' => 'in']);
220 220
         }
221 221
 
222 222
         if ($this->numPerPage()) {
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
 
322 322
         $ids = explode(',', $ids);
323 323
 
324
-        $loader->addFilter('id', $ids, [ 'operator' => 'in' ])
325
-            ->addOrder('id', 'values', [ 'values' => $ids ]);
324
+        $loader->addFilter('id', $ids, ['operator' => 'in'])
325
+            ->addOrder('id', 'values', ['values' => $ids]);
326 326
 
327 327
         if (count($options) > 0) {
328 328
             foreach ($options as $key => $option) {
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         $loader = $this->loader()->archive();
370 370
 
371 371
         if ($this->category()) {
372
-            $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]);
372
+            $loader->addFilter('category', $this->category(), ['operator' => 'in']);
373 373
         }
374 374
         if ($this->numPerPage()) {
375 375
             $loader->setPage($this->page());
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
     /**
232 232
      * @param integer|null $id The event id.
233
-     * @return mixed
233
+     * @return EventInterface
234 234
      */
235 235
     public function entry($id = null)
236 236
     {
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
     }
399 399
 
400 400
     /**
401
-     * @return mixed The previous event
401
+     * @return EventInterface The previous event
402 402
      */
403 403
     public function prev()
404 404
     {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     }
411 411
 
412 412
     /**
413
-     * @return mixed The next event
413
+     * @return EventInterface The next event
414 414
      */
415 415
     public function next()
416 416
     {
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 
505 505
     /**
506 506
      * Amount of event (total)
507
-     * @return integer How many event?
507
+     * @return boolean How many event?
508 508
      */
509 509
     public function numEvent()
510 510
     {
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
     }
568 568
 
569 569
     /**
570
-     * @return mixed
570
+     * @return string
571 571
      */
572 572
     public function featIdent()
573 573
     {
Please login to merge, or discard this patch.
src/Charcoal/Cms/Service/Manager/NewsManager.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $loader->addOrder('news_date', 'desc');
123 123
 
124 124
         if ($this->category()) {
125
-            $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]);
125
+            $loader->addFilter('category', $this->category(), ['operator' => 'in']);
126 126
         }
127 127
         if ($this->numPerPage()) {
128 128
             $loader->setPage($this->page());
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 
224 224
         $ids = explode(',', $ids);
225 225
 
226
-        $loader->addFilter('id', $ids, [ 'operator' => 'in' ])
227
-            ->addOrder('id', 'values', [ 'values' => $ids ]);
226
+        $loader->addFilter('id', $ids, ['operator' => 'in'])
227
+            ->addOrder('id', 'values', ['values' => $ids]);
228 228
 
229 229
         if (count($options) > 0) {
230 230
             foreach ($options as $key => $option) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         $loader->addOrder('news_date', 'desc');
273 273
 
274 274
         if ($this->category()) {
275
-            $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]);
275
+            $loader->addFilter('category', $this->category(), ['operator' => 'in']);
276 276
         }
277 277
         if ($this->numPerPage()) {
278 278
             $loader->setPage($this->page());
Please login to merge, or discard this patch.
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
     /**
151 151
      * @param integer|null $id The news id.
152
-     * @return mixed
152
+     * @return NewsInterface
153 153
      */
154 154
     public function entry($id = null)
155 155
     {
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     }
317 317
 
318 318
     /**
319
-     * @return mixed The previous news
319
+     * @return NewsInterface The previous news
320 320
      */
321 321
     public function prev()
322 322
     {
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
     }
329 329
 
330 330
     /**
331
-     * @return mixed The next news
331
+     * @return NewsInterface The next news
332 332
      */
333 333
     public function next()
334 334
     {
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 
401 401
     /**
402 402
      * Amount of news (total)
403
-     * @return integer How many news?
403
+     * @return boolean How many news?
404 404
      */
405 405
     public function numNews()
406 406
     {
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     }
443 443
 
444 444
     /**
445
-     * @return mixed
445
+     * @return string
446 446
      */
447 447
     public function objType()
448 448
     {
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
     }
451 451
 
452 452
     /**
453
-     * @return mixed
453
+     * @return string
454 454
      */
455 455
     public function featIdent()
456 456
     {
Please login to merge, or discard this patch.
src/Charcoal/Cms/Config/NewsConfig.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-     * @return boolean Entry cycle.
62
+     * @return string Entry cycle.
63 63
      */
64 64
     public function entryCycle()
65 65
     {
Please login to merge, or discard this patch.
src/Charcoal/Cms/Support/Helpers/DateHelper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -263,7 +263,7 @@
 block discarded – undo
263 263
     }
264 264
 
265 265
     /**
266
-     * @param mixed $format DateTime to be formatted.
266
+     * @param string $format DateTime to be formatted.
267 267
      * @return mixed
268 268
      */
269 269
     private function crossPlatformFormat($format)
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -199,18 +199,18 @@  discard block
 block discarded – undo
199 199
                            ? $this->translator()->translation($case['formats']['to'])
200 200
                            : null;
201 201
 
202
-        $formats['from'] = $this->crossPlatformFormat((string)$formats['from']);
203
-        $formats['to']   = $this->crossPlatformFormat((string)$formats['to']);
202
+        $formats['from'] = $this->crossPlatformFormat((string) $formats['from']);
203
+        $formats['to']   = $this->crossPlatformFormat((string) $formats['to']);
204 204
 
205 205
         if (!$this->to || !$formats['to']) {
206 206
             return sprintf(
207
-                (string)$content,
207
+                (string) $content,
208 208
                 strftime($formats['from'], $this->from->getTimestamp())
209 209
             );
210 210
         }
211 211
 
212 212
         return sprintf(
213
-            (string)$content,
213
+            (string) $content,
214 214
             strftime($formats['from'], $this->from->getTimestamp()),
215 215
             strftime($formats['to'], $this->to->getTimestamp())
216 216
         );
@@ -235,13 +235,13 @@  discard block
 block discarded – undo
235 235
 
236 236
         if (!$this->to || !$formats['to']) {
237 237
             return sprintf(
238
-                (string)$content,
238
+                (string) $content,
239 239
                 strftime($formats['from'], $this->from->getTimestamp())
240 240
             );
241 241
         }
242 242
 
243 243
         return sprintf(
244
-            (string)$content,
244
+            (string) $content,
245 245
             strftime($formats['from'], $this->from->getTimestamp()),
246 246
             strftime($formats['to'], $this->to->getTimestamp())
247 247
         );
Please login to merge, or discard this patch.
src/Charcoal/Cms/AbstractEvent.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     {
32 32
         parent::__construct($data);
33 33
 
34
-        if (is_callable([ $this, 'defaultData' ])) {
34
+        if (is_callable([$this, 'defaultData'])) {
35 35
             $this->setData($this->defaultData());
36 36
         }
37 37
     }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     }
214 214
 
215 215
     /**
216
-     * @param  string|DateTimeInterface|null $startDate Event starting date.
216
+     * @param  string $startDate Event starting date.
217 217
      * @throws InvalidArgumentException If the timestamp is invalid.
218 218
      * @return self
219 219
      */
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     }
247 247
 
248 248
     /**
249
-     * @param  string|DateTimeInterface|null $endDate Event end date.
249
+     * @param  null|DateTimeInterface $endDate Event end date.
250 250
      * @throws InvalidArgumentException If the timestamp is invalid.
251 251
      * @return self
252 252
      */
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     }
299 299
 
300 300
     /**
301
-     * @return Translation|string|null
301
+     * @return null|Translation
302 302
      */
303 303
     public function defaultMetaDescription()
304 304
     {
Please login to merge, or discard this patch.
src/Charcoal/Property/TemplateProperty.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace Charcoal\Property;
4 4
 
5 5
 use PDO;
6
-
7
-use RuntimeException;
8 6
 use InvalidArgumentException;
9 7
 
10 8
 // From Pimple
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                 }
100 100
 
101 101
                 $struct    = $this->availableTemplates[$choiceIdent];
102
-                $immutable = [ 'value' => $struct['value'] ];
102
+                $immutable = ['value' => $struct['value']];
103 103
 
104 104
                 return array_replace($struct, $choice, $immutable);
105 105
             } elseif (isset($choice['template']) || isset($choice['controller']) || isset($choice['class'])) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 return '';
140 140
             }
141 141
         } elseif ($val instanceof Translation) {
142
-            $propertyValue = (string)$val;
142
+            $propertyValue = (string) $val;
143 143
         } else {
144 144
             $propertyValue = $val;
145 145
         }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         $val = $this->val();
188 188
         if ($this->hasChoice($val)) {
189 189
             $choice = $this->choice($val);
190
-            $keys   = [ 'controller', 'template', 'class' ];
190
+            $keys   = ['controller', 'template', 'class'];
191 191
             foreach ($keys as $key) {
192 192
                 if (isset($choice[$key])) {
193 193
                     return $choice[$key];
Please login to merge, or discard this patch.
src/Charcoal/Cms/Route/GenericRoute.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -499,7 +499,7 @@
 block discarded – undo
499 499
             if (isset($available[$code])) {
500 500
                 $locale = $available[$code];
501 501
                 if (isset($locale['locales'])) {
502
-                    $choices = (array)$locale['locales'];
502
+                    $choices = (array) $locale['locales'];
503 503
                     array_push($locales, ...$choices);
504 504
                 } elseif (isset($locale['locale'])) {
505 505
                     array_push($locales, $locale['locale']);
Please login to merge, or discard this patch.
src/Charcoal/Cms/Service/Loader/SectionLoader.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
         $loader = $this->all();
74 74
         $operator = [];
75 75
         if (!$this->baseSection()) {
76
-            $operator = [ 'operator' => 'IS NULL' ];
76
+            $operator = ['operator' => 'IS NULL'];
77 77
         }
78 78
         $loader->addFilter('master', $this->baseSection(), $operator);
79 79
 
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace Charcoal\Cms\Service\Loader;
4 4
 
5
-use Exception;
6
-
7 5
 // From 'charcoal-core'
8 6
 use Charcoal\Loader\CollectionLoader;
9 7
 
@@ -11,7 +9,6 @@  discard block
 block discarded – undo
11 9
 use Charcoal\Object\ObjectRoute;
12 10
 
13 11
 // From 'charcoal-translator'
14
-use Charcoal\Translator\TranslatorAwareTrait;
15 12
 
16 13
 /**
17 14
  * Section Loader
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@
 block discarded – undo
222 222
     }
223 223
 
224 224
     /**
225
-     * @return object
225
+     * @return string
226 226
      */
227 227
     public function objType()
228 228
     {
Please login to merge, or discard this patch.