Test Setup Failed
Push — master ( 84252e...d1a772 )
by
unknown
02:53
created
src/Charcoal/Admin/Widget/GroupAttachmentWidget.php 1 patch
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.
src/Charcoal/Admin/Widget/Cms/SectionTableTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
                 switch ($sectionType) {
98 98
                     case AbstractSection::TYPE_EXTERNAL:
99
-                        $externalUrl = (string)$object->externalUrl();
99
+                        $externalUrl = (string) $object->externalUrl();
100 100
                         $linkExcerpt = '';
101 101
                         $tagTemplate = '<span class="fa fa-link" data-toggle="tooltip" '.
102 102
                             'data-placement="auto" title="%1$s"></span>';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         }
124 124
 
125 125
         if ($propertyIdent === 'title') {
126
-            if (is_callable([ $object, 'navMenu' ]) && $object->navMenu()) {
126
+            if (is_callable([$object, 'navMenu']) && $object->navMenu()) {
127 127
                 $propertyValue .= sprintf(
128 128
                     ' &nbsp; '.
129 129
                     '<span class="fa fa-list" data-toggle="tooltip" '.
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
                 );
136 136
             }
137 137
 
138
-            if (is_callable([ $object, 'locked' ]) && $object->locked()) {
138
+            if (is_callable([$object, 'locked']) && $object->locked()) {
139 139
                 $propertyValue .= sprintf(
140 140
                     ' &nbsp; '.
141 141
                     '<span class="fa fa-lock" data-toggle="tooltip" '.
Please login to merge, or discard this patch.
src/Charcoal/Cms/TemplateableTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         if ($property instanceof SelectablePropertyInterface) {
108 108
             if ($property->hasChoice($templateIdent)) {
109 109
                 $choice = $property->choice($templateIdent);
110
-                $keys   = [ 'controller', 'template', 'class' ];
110
+                $keys   = ['controller', 'template', 'class'];
111 111
                 foreach ($keys as $key) {
112 112
                     if (isset($choice[$key])) {
113 113
                         return $choice[$key];
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     public function hasTemplateOptions()
184 184
     {
185 185
         if ($this->templateOptionsStructure()) {
186
-            return (bool)count(
186
+            return (bool) count(
187 187
                 iterator_to_array(
188 188
                     $this->templateOptionsStructure()->properties()
189 189
                 )
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                 $struct = $property->structureVal($obj[$propertyIdent]);
246 246
 
247 247
                 /** Provide support for dynamically wrapping translation sets.  */
248
-                if (in_array(get_class($struct), [ Model::class, StructureModel::class ])) {
248
+                if (in_array(get_class($struct), [Model::class, StructureModel::class])) {
249 249
                     $struct = $this->translateTemplateOptionsModel($struct);
250 250
                 }
251 251
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
             if ($property instanceof SelectablePropertyInterface) {
291 291
                 if ($property->hasChoice($val)) {
292 292
                     $choice = $property->choice($val);
293
-                    $keys   = [ 'controller', 'template', 'class' ];
293
+                    $keys   = ['controller', 'template', 'class'];
294 294
                     foreach ($keys as $key) {
295 295
                         if (isset($choice[$key])) {
296 296
                             $interface = $choice[$key];
Please login to merge, or discard this patch.
src/Charcoal/Cms/ServiceProvider/CmsServiceProvider.php 1 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/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/NewsCategory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 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
     }
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
         parent::validate($v);
83 83
 
84 84
         foreach ($this->translator()->locales() as $locale => $value) {
85
-            if (!(string)$this['name'][$locale]) {
85
+            if (!(string) $this['name'][$locale]) {
86 86
                 $this->validator()->error(
87
-                    (string)$this->translator()->translation([
87
+                    (string) $this->translator()->translation([
88 88
                         'fr' => 'Le NOM doit être rempli dans toutes les langues.',
89 89
                         'en' => 'The NAME must be filled in all languages.',
90 90
                     ])
Please login to merge, or discard this patch.
src/Charcoal/Cms/AbstractWebTemplate.php 1 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/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.
src/Charcoal/Cms/Support/LocaleAwareTrait.php 1 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.