Test Setup Failed
Push — master ( bf8bab...84252e )
by
unknown
01:10 queued 11s
created
src/Charcoal/Admin/Widget/GroupAttachmentWidget.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
             }
201 201
 
202 202
             $attachmentWidgets = $structureMetadata->get('attachments.widgets');
203
-            foreach ((array)$attachmentWidgets as $ident => $metadata) {
203
+            foreach ((array) $attachmentWidgets as $ident => $metadata) {
204 204
                 $this->addGroup($ident, $metadata);
205 205
             }
206 206
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -238,7 +238,7 @@
 block discarded – undo
238 238
     /**
239 239
      * Retrieve the form object's template controller identifier.
240 240
      *
241
-     * @return mixed
241
+     * @return string
242 242
      */
243 243
     public function controllerIdent()
244 244
     {
Please login to merge, or discard this patch.
src/Charcoal/Cms/Section/BlocksSection.php 1 patch
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -2,13 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Charcoal\Cms\Section;
4 4
 
5
-use RuntimeException;
6
-
7 5
 // From Pimple
8
-use Pimple\Container;
9 6
 
10 7
 // From 'charcoal-core'
11
-use Charcoal\Loader\CollectionLoader;
12 8
 
13 9
 // From 'charcoal-cms'
14 10
 use Charcoal\Cms\AbstractSection;
Please login to merge, or discard this patch.
src/Charcoal/Cms/ServiceProvider/CmsServiceProvider.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -7,14 +7,12 @@
 block discarded – undo
7 7
 use Pimple\ServiceProviderInterface;
8 8
 
9 9
 // From 'charcoal-core'
10
-use Charcoal\Model\AbstractModel;
11 10
 
12 11
 // From 'charcoal-factory'
13 12
 use Charcoal\Factory\GenericFactory as Factory;
14 13
 
15 14
 // From 'charcoal-cms'
16 15
 use Charcoal\Cms\SectionInterface;
17
-use Charcoal\Cms\Config;
18 16
 use Charcoal\Cms\Config\CmsConfig;
19 17
 use Charcoal\Cms\Service\Loader\EventLoader;
20 18
 use Charcoal\Cms\Service\Loader\NewsLoader;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
          * @param Container $container Pimple DI Container.
61 61
          * @return CmsConfig Website configurations (from cms.json).
62 62
          */
63
-        $container['cms/config'] = function (Container $container) {
63
+        $container['cms/config'] = function(Container $container) {
64 64
             $appConfig = $container['config'];
65 65
             $cms = $appConfig->get('cms');
66 66
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
          * @param Container $container Pimple DI Container.
96 96
          * @return DateHelper
97 97
          */
98
-        $container['cms/date/helper'] = function (Container $container) {
98
+        $container['cms/date/helper'] = function(Container $container) {
99 99
             return new DateHelper([
100 100
                 'date_formats' => $container['cms/config']->get('date_formats'),
101 101
                 'time_formats' => $container['cms/config']->get('time_formats'),
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
          * @param Container $container Pimple DI Container.
108 108
          * @return DateHelper
109 109
          */
110
-        $container['date/helper'] = function (Container $container) {
110
+        $container['date/helper'] = function(Container $container) {
111 111
             trigger_error(sprintf(
112 112
                 '%s is deprecated, use %s instead',
113 113
                 '$container[\'date/helper\']',
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
          * @param Container $container Pimple DI Container.
129 129
          * @return Factory
130 130
          */
131
-        $container['cms/section/factory'] = function (Container $container) {
131
+        $container['cms/section/factory'] = function(Container $container) {
132 132
             return new Factory([
133 133
                 'base_class'       => SectionInterface::class,
134 134
                 'arguments'        => $container['model/factory']->arguments(),
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
          * @param Container $container Pimple DI Container.
143 143
          * @return SectionLoader
144 144
          */
145
-        $container['cms/section/loader'] = function (Container $container) {
145
+        $container['cms/section/loader'] = function(Container $container) {
146 146
             $sectionLoader = new SectionLoader([
147 147
                 'loader'     => $container['model/collection/loader'],
148 148
                 'factory'    => $container['model/factory'],
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
          * @param Container $container Pimple DI Container.
172 172
          * @return NewsLoader
173 173
          */
174
-        $container['cms/news/loader'] = function (Container $container) {
174
+        $container['cms/news/loader'] = function(Container $container) {
175 175
             $newsLoader = new NewsLoader([
176 176
                 'loader'     => $container['model/collection/loader'],
177 177
                 'factory'    => $container['model/factory'],
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
          * @param Container $container
193 193
          * @return NewsManager
194 194
          */
195
-        $container['cms/news/manager'] = function (Container $container) {
195
+        $container['cms/news/manager'] = function(Container $container) {
196 196
 
197 197
             $newsManager = new NewsManager([
198 198
                 'loader'      => $container['model/collection/loader'],
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
          * @param Container $container Pimple DI Container.
218 218
          * @return EventLoader
219 219
          */
220
-        $container['cms/event/loader'] = function (Container $container) {
220
+        $container['cms/event/loader'] = function(Container $container) {
221 221
             $eventLoader = new EventLoader([
222 222
                 'loader'     => $container['model/collection/loader'],
223 223
                 'factory'    => $container['model/factory'],
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
          * @param Container $container
242 242
          * @return EventManager
243 243
          */
244
-        $container['cms/event/manager'] = function (Container $container) {
244
+        $container['cms/event/manager'] = function(Container $container) {
245 245
 
246 246
             $eventManager = new EventManager([
247 247
                 'loader'       => $container['model/collection/loader'],
Please login to merge, or discard this patch.
src/Charcoal/Cms/Service/Loader/EventLoader.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     }
88 88
 
89 89
     /**
90
-     * @param mixed $date The news date to filter
90
+     * @param DateTime $date The news date to filter
91 91
      *                    [startDate, endDate]
92 92
      *                    DateTimeInterface
93 93
      *                    string.
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     }
104 104
 
105 105
     /**
106
-     * @param mixed $date The news date to filter
106
+     * @param DateTime $date The news date to filter
107 107
      *                    [startDate, endDate]
108 108
      *                    DateTimeInterface
109 109
      *                    string.
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     }
120 120
 
121 121
     /**
122
-     * @return mixed
122
+     * @return string
123 123
      */
124 124
     public function lifespan()
125 125
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $now = new DateTime();
58 58
         $loader = $this->all();
59
-        $loader->addFilter('publishDate', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ])
59
+        $loader->addFilter('publishDate', $now->format('Y-m-d H:i:s'), ['operator' => '<='])
60 60
             ->addOrder('start_date', 'asc');
61 61
 
62 62
         return $loader;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $date = $this->parseAsDate($date);
99 99
         $loader = $this->published();
100
-        $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), [ 'operator' => '>=' ]);
100
+        $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), ['operator' => '>=']);
101 101
 
102 102
         return $loader;
103 103
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $date = $this->parseAsDate($date);
115 115
         $loader = $this->published();
116
-        $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), [ 'operator' => '<' ]);
116
+        $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), ['operator' => '<']);
117 117
 
118 118
         return $loader;
119 119
     }
Please login to merge, or discard this patch.
src/Charcoal/Cms/AbstractEvent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     {
113 113
         parent::__construct($data);
114 114
 
115
-        if (is_callable([ $this, 'defaultData' ])) {
115
+        if (is_callable([$this, 'defaultData'])) {
116 116
             $this->setData($this->defaultData());
117 117
         }
118 118
     }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
      */
366 366
     public function setTicketPriceMin($price)
367 367
     {
368
-        $this->ticketPriceMin = (float)$price;
368
+        $this->ticketPriceMin = (float) $price;
369 369
         return $this;
370 370
     }
371 371
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
      */
384 384
     public function setTicketPriceMax($price)
385 385
     {
386
-        $this->ticketPriceMax = (float)$price;
386
+        $this->ticketPriceMax = (float) $price;
387 387
         return $this;
388 388
     }
389 389
 
Please login to merge, or discard this patch.
src/Charcoal/Cms/AbstractWebTemplate.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
     /**
167 167
      * Retrieve the canonical URI of the object.
168 168
      *
169
-     * @return \Psr\Http\Message\UriInterface|string|null
169
+     * @return UriInterface|null
170 170
      */
171 171
     public function canonicalUrl()
172 172
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 use Pimple\Container;
13 13
 
14 14
 // From 'charcoal-core'
15
-use Charcoal\Model\ModelInterface;
16 15
 
17 16
 // From 'charcoal-translator'
18 17
 use Charcoal\Translator\TranslatorAwareTrait;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
         $title   = null;
198 198
 
199 199
         if ($context instanceof MetatagInterface) {
200
-            $title = (string)$context['metaTitle'];
200
+            $title = (string) $context['metaTitle'];
201 201
         }
202 202
 
203 203
         if (!$title) {
204
-            $title = (string)$this->fallbackMetaTitle();
204
+            $title = (string) $this->fallbackMetaTitle();
205 205
         }
206 206
 
207 207
         return $title;
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      */
217 217
     protected function fallbackMetaTitle()
218 218
     {
219
-        return (string)$this->title();
219
+        return (string) $this->title();
220 220
     }
221 221
 
222 222
     /**
@@ -230,11 +230,11 @@  discard block
 block discarded – undo
230 230
 
231 231
         $desc = null;
232 232
         if ($context instanceof MetatagInterface) {
233
-            $desc = (string)$context['metaDescription'];
233
+            $desc = (string) $context['metaDescription'];
234 234
         }
235 235
 
236 236
         if (!$desc) {
237
-            $desc = (string)$this->fallbackMetaDescription();
237
+            $desc = (string) $this->fallbackMetaDescription();
238 238
         }
239 239
 
240 240
         return $desc;
@@ -263,11 +263,11 @@  discard block
 block discarded – undo
263 263
 
264 264
         $img = null;
265 265
         if ($context instanceof MetatagInterface) {
266
-            $img = (string)$context['metaImage'];
266
+            $img = (string) $context['metaImage'];
267 267
         }
268 268
 
269 269
         if (!$img) {
270
-            $img = (string)$this->fallbackMetaImage();
270
+            $img = (string) $this->fallbackMetaImage();
271 271
         }
272 272
 
273 273
         return $this->resolveMetaImage($img);
@@ -342,11 +342,11 @@  discard block
 block discarded – undo
342 342
 
343 343
         $img = null;
344 344
         if ($context instanceof MetatagInterface) {
345
-            $img = (string)$context['opengraphImage'];
345
+            $img = (string) $context['opengraphImage'];
346 346
         }
347 347
 
348 348
         if (!$img) {
349
-            $img = (string)$this->fallbackOpengraphImage();
349
+            $img = (string) $this->fallbackOpengraphImage();
350 350
         }
351 351
 
352 352
         if ($img) {
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 
413 413
             $this->seoMetadata[] = [
414 414
                 'name'    => $key,
415
-                'content' => (string)$value
415
+                'content' => (string) $value
416 416
             ];
417 417
         }
418 418
 
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
         } else {
508 508
             $parts = parse_url($uri);
509 509
             if (!isset($parts['scheme'])) {
510
-                if (!in_array($uri[0], [ '/', '#', '?' ])) {
510
+                if (!in_array($uri[0], ['/', '#', '?'])) {
511 511
                     $path  = isset($parts['path']) ? $parts['path'] : '';
512 512
                     $query = isset($parts['query']) ? $parts['query'] : '';
513 513
                     $hash  = isset($parts['fragment']) ? $parts['fragment'] : '';
Please login to merge, or discard this patch.
src/Charcoal/Cms/Support/ContextualTemplateTrait.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
      *
59 59
      * @param  string $className The class name of the section model.
60 60
      * @throws InvalidArgumentException If the class name is not a string.
61
-     * @return AbstractPropertyDisplay Chainable
61
+     * @return ContextualTemplateTrait Chainable
62 62
      */
63 63
     public function setGenericContextClass($className)
64 64
     {
Please login to merge, or discard this patch.
src/Charcoal/Cms/Support/LocaleAwareTrait.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      * Note: The application's locale is already modified and will be reset
169 169
      * after processing all available languages.
170 170
      *
171
-     * @param  mixed $context      The translated {@see \Charcoal\Model\ModelInterface model}
171
+     * @param  \Charcoal\Model\ModelInterface|null $context      The translated {@see \Charcoal\Model\ModelInterface model}
172 172
      *     or array-accessible structure.
173 173
      * @param  array $localeStruct The currently iterated language.
174 174
      * @return array Returns a link structure.
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     /**
214 214
      * Yield the alternate translations associated with the current route.
215 215
      *
216
-     * @return Generator|null
216
+     * @return \Generator
217 217
      */
218 218
     public function alternateTranslations()
219 219
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
     protected function formatAlternateTranslation($context, array $localeStruct)
177 177
     {
178 178
         return [
179
-            'id'       => ($context['id']) ? : $this->templateName(),
180
-            'title'    => ((string)$context['title']) ? : $this->title(),
179
+            'id'       => ($context['id']) ?: $this->templateName(),
180
+            'title'    => ((string) $context['title']) ?: $this->title(),
181 181
             'url'      => $this->formatAlternateTranslationUrl($context, $localeStruct),
182 182
             'hreflang' => $localeStruct['code'],
183 183
             'locale'   => $localeStruct['locale'],
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     {
202 202
         $isRoutable = ($context instanceof RoutableInterface && $context->isActiveRoute());
203 203
         $langCode   = $localeStruct['code'];
204
-        $path       = ($isRoutable ? $context->url($langCode) : ($this->currentUrl() ? : $langCode));
204
+        $path       = ($isRoutable ? $context->url($langCode) : ($this->currentUrl() ?: $langCode));
205 205
 
206 206
         if ($path instanceof UriInterface) {
207 207
             $path = $path->getPath();
Please login to merge, or discard this patch.
src/Charcoal/Cms/Support/DocumentTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 continue;
87 87
             }
88 88
 
89
-            $segments[$key] = (string)$value;
89
+            $segments[$key] = (string) $value;
90 90
         }
91 91
 
92 92
         return $segments;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     final public function documentTitle()
130 130
     {
131 131
         $parts = $this->documentTitleParts();
132
-        if (array_diff_key([ 'title' => true, 'site' => true ], $parts)) {
132
+        if (array_diff_key(['title' => true, 'site' => true], $parts)) {
133 133
             throw new InvalidArgumentException(
134 134
                 'The document title parts requires at least a "title" and a "site"'
135 135
             );
Please login to merge, or discard this patch.