Test Setup Failed
Push — a-simpler-manager ( d99f82...467c43 )
by Ben
06:44
created
src/Shared/Concerns/Translatable/Translatable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         $available_locales = static::availableLocales();
147 147
         $current_locales = $this->translations->pluck('locale')->toArray();
148 148
 
149
-        return array_filter($available_locales, function ($v) use ($current_locales, $available) {
149
+        return array_filter($available_locales, function($v) use ($current_locales, $available) {
150 150
             return $available ? in_array($v, $current_locales) : !in_array($v, $current_locales);
151 151
         }, ARRAY_FILTER_USE_BOTH);
152 152
     }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     private function validateLocale($locale)
160 160
     {
161 161
         if (!in_array($locale, static::availableLocales())) {
162
-            throw new InvalidArgumentException('Locale [' . $locale . '] is not available');
162
+            throw new InvalidArgumentException('Locale ['.$locale.'] is not available');
163 163
         }
164 164
     }
165 165
 
Please login to merge, or discard this patch.
src/Shared/Concerns/Viewable/ViewPath.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,22 +34,22 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function get(): string
36 36
     {
37
-        $basePath = $this->viewBasePath ? $this->viewBasePath . '.' : '';
37
+        $basePath = $this->viewBasePath ? $this->viewBasePath.'.' : '';
38 38
         $guessedParentViewName = $this->parent ? $this->parent->viewKey() : '';
39 39
         $guessedViewName = $this->viewable->viewKey();
40 40
 
41 41
         $viewPaths = [
42
-            $basePath . $guessedParentViewName . '.' . $guessedViewName,
43
-            $basePath . $guessedViewName,
44
-            $basePath . $guessedViewName . '.show',
45
-            $basePath . 'show',
42
+            $basePath.$guessedParentViewName.'.'.$guessedViewName,
43
+            $basePath.$guessedViewName,
44
+            $basePath.$guessedViewName.'.show',
45
+            $basePath.'show',
46 46
         ];
47 47
 
48 48
         // In case the collection set is made out of pages, we'll also allow to use the
49 49
         // generic collection page view for these sets as well as a fallback view
50 50
         if ($this->viewable instanceof Set && $this->viewable->first() instanceof ViewableContract) {
51
-            $viewPaths[] = $basePath . $guessedParentViewName . '.' . $this->viewable->first()->viewKey();
52
-            $viewPaths[] = $basePath . $this->viewable->first()->viewKey();
51
+            $viewPaths[] = $basePath.$guessedParentViewName.'.'.$this->viewable->first()->viewKey();
52
+            $viewPaths[] = $basePath.$this->viewable->first()->viewKey();
53 53
         }
54 54
 
55 55
         foreach ($viewPaths as $viewPath) {
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
             return $viewPath;
61 61
         }
62 62
 
63
-        if (!view()->exists($basePath . 'show')) {
64
-            throw new NotFoundView('Viewfile not found for [' . get_class($this->viewable) . ']. Make sure the view [' . $basePath . $guessedViewName . '] or the default view [' . $basePath . 'show] exists.');
63
+        if (!view()->exists($basePath.'show')) {
64
+            throw new NotFoundView('Viewfile not found for ['.get_class($this->viewable).']. Make sure the view ['.$basePath.$guessedViewName.'] or the default view ['.$basePath.'show] exists.');
65 65
         }
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
src/Shared/Concerns/Sortable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
      */
20 20
     public static function reorderAgainstSiblings(array $sequence)
21 21
     {
22
-        array_walk($sequence, function ($id, $i) {
22
+        array_walk($sequence, function($id, $i) {
23 23
             self::findOrFail($id)->reorder($i);
24 24
         });
25 25
     }
Please login to merge, or discard this patch.
src/Shared/Concerns/Morphable/Morphables.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         }
17 17
 
18 18
         if (!class_exists($class)) {
19
-            throw new NotFoundMorphKey('No class found by morphkey [' . $class . ']. Make sure that the morphkey is a valid class reference.');
19
+            throw new NotFoundMorphKey('No class found by morphkey ['.$class.']. Make sure that the morphkey is a valid class reference.');
20 20
         }
21 21
 
22 22
         return new $class($attributes);
Please login to merge, or discard this patch.
src/Shared/Concerns/Morphable/EloquentMorphableInstantiation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     private function convertToMorphInstance(Model $model, string $morphKey): Model
46 46
     {
47 47
         // Here we load up the proper collection model instead of the generic base class.
48
-        return tap(Morphables::instance($morphKey, $model->attributes), function ($instance) use ($model) {
48
+        return tap(Morphables::instance($morphKey, $model->attributes), function($instance) use ($model) {
49 49
             $instance->setRawAttributes($model->attributes);
50 50
             $instance->setRelations($model->relations);
51 51
             $instance->exists = $model->exists;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         if ($this->requiresCustomTranslation($instance)) {
67 67
             if (!is_array($instance->with) || !in_array('translations', $instance->with)) {
68 68
                 $instance->unsetRelation('translations');
69
-            } else {
69
+            }else {
70 70
                 // TODO: this is a heavy queryload since it loads new translations for each model...
71 71
                 // Removing this could reduce load by approx. 50%.
72 72
                 // $instance->load('translations');
Please login to merge, or discard this patch.
src/Shared/Concerns/Morphable/Morphable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 
59 59
     protected function initializeMorphable()
60 60
     {
61
-        if(!isset($this->morph_key)) {
61
+        if (!isset($this->morph_key)) {
62 62
             $this->morph_key = $this->morphKey();
63 63
         }
64 64
     }
Please login to merge, or discard this patch.
src/Shared/Concerns/Sluggable/UniqueSlug.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $this->model = $model;
21 21
         $this->blacklist = $blacklist;
22 22
 
23
-        $this->slugResolver = function ($slug) {
23
+        $this->slugResolver = function($slug) {
24 24
             return Str::slug($slug);
25 25
         };
26 26
     }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $i = 1;
44 44
 
45 45
         while (!$this->isSlugUnique($slug, $entity)) {
46
-            $slug = $originalslug . '-' . $i;
46
+            $slug = $originalslug.'-'.$i;
47 47
             $i++;
48 48
         }
49 49
 
Please login to merge, or discard this patch.
src/Shared/helpers.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $manifestPath = '/chief-assets/back';
21 21
 
22 22
         // Manifest expects each entry to start with a leading slash - we make sure to deduplicate the manifest path.
23
-        $entry = str_replace($manifestPath, '', '/' . ltrim($filepath, '/'));
23
+        $entry = str_replace($manifestPath, '', '/'.ltrim($filepath, '/'));
24 24
 
25 25
         try {
26 26
             // Paths should be given relative to the manifestpath so make sure to remove the basepath
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         } catch (\Exception $e) {
29 29
             \Illuminate\Support\Facades\Log::error($e);
30 30
 
31
-            return $manifestPath . $entry;
31
+            return $manifestPath.$entry;
32 32
         }
33 33
     }
34 34
 }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
         $teaser = mb_substr($text, 0, $max, 'utf-8');
118 118
 
119
-        return strlen($text) <= $max ? $teaser : $teaser . $ending;
119
+        return strlen($text) <= $max ? $teaser : $teaser.$ending;
120 120
     }
121 121
 }
122 122
 
@@ -247,16 +247,16 @@  discard block
 block discarded – undo
247 247
             'fragment',
248 248
         ], null), $parsed_url, $overrides);
249 249
 
250
-        $scheme = $parsed_url['scheme'] ? $parsed_url['scheme'] . '://' : null;
251
-        $port = $parsed_url['port'] ? ':' . $parsed_url['port'] : null;
252
-        $fragment = $parsed_url['fragment'] ? '#' . $parsed_url['fragment'] : null;
250
+        $scheme = $parsed_url['scheme'] ? $parsed_url['scheme'].'://' : null;
251
+        $port = $parsed_url['port'] ? ':'.$parsed_url['port'] : null;
252
+        $fragment = $parsed_url['fragment'] ? '#'.$parsed_url['fragment'] : null;
253 253
 
254
-        $baseurl = $scheme . $parsed_url['host'] . $port . $parsed_url['path'];
254
+        $baseurl = $scheme.$parsed_url['host'].$port.$parsed_url['path'];
255 255
         $current_query = [];
256 256
 
257 257
         $_query = explode('&', $parsed_url['query']);
258 258
 
259
-        array_map(function ($v) use (&$current_query) {
259
+        array_map(function($v) use (&$current_query) {
260 260
             if (!$v) {
261 261
                 return;
262 262
             }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
         $query = urldecode(http_build_query(array_merge($current_query, $query_params)));
276 276
 
277
-        return $baseurl . '?' . $query . $fragment;
277
+        return $baseurl.'?'.$query.$fragment;
278 278
     }
279 279
 }
280 280
 
Please login to merge, or discard this patch.
src/Shared/ModelReferences/ModelReference.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
     public static function fromString(string $reference): self
25 25
     {
26 26
         if (false == strpos($reference, '@')) {
27
-            throw new \InvalidArgumentException('Invalid reference composition. A model reference should consist of schema <class>@<id>. [' . $reference . '] was passed instead.');
27
+            throw new \InvalidArgumentException('Invalid reference composition. A model reference should consist of schema <class>@<id>. ['.$reference.'] was passed instead.');
28 28
         }
29 29
 
30 30
         list($className, $id) = explode('@', $reference);
31 31
 
32
-        return new static($className, (int) $id);
32
+        return new static($className, (int)$id);
33 33
     }
34 34
 
35 35
     /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     {
41 41
         $className = $this->className();
42 42
 
43
-        if($this->id == 0) {
43
+        if ($this->id == 0) {
44 44
             return new $className($attributes);
45 45
         }
46 46
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function get(): string
64 64
     {
65
-        return $this->className . '@' . $this->id;
65
+        return $this->className.'@'.$this->id;
66 66
     }
67 67
 
68 68
     public function equals($other): bool
Please login to merge, or discard this patch.