Passed
Push — analysis-qy4l7D ( 577fae )
by Philippe
28:29 queued 18:54
created
src/Fields/Types/MediaField.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Thinktomorrow\Chief\Fields\Types;
6 6
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             return $this;
41 41
         }
42 42
 
43
-        return 'files['. ($this->values['name'] ?? $this->key()).']';
43
+        return 'files['.($this->values['name'] ?? $this->key()).']';
44 44
     }
45 45
 
46 46
     public function getFieldValue(Model $model, $locale = null)
Please login to merge, or discard this patch.
src/Urls/MemoizedUrlRecord.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
     public static function getByModel(Model $model)
46 46
     {
47
-        return chiefMemoize('url-records-get-by-model', function ($model) {
47
+        return chiefMemoize('url-records-get-by-model', function($model) {
48 48
             return parent::getByModel($model);
49 49
         }, [$model]);
50 50
     }
Please login to merge, or discard this patch.
src/Urls/ChiefResponse.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
                 throw new \DomainException('Corrupt target model for this url request. Model by reference ['.$urlRecord->model_type.'@'.$urlRecord->model_id.'] has probably been archived or deleted.');
45 45
             }
46 46
 
47
-            if (method_exists($model, 'isPublished') && ! $model->isPublished()) {
47
+            if (method_exists($model, 'isPublished') && !$model->isPublished()) {
48 48
 
49 49
                 /** When admin is logged in and this request is in preview mode, we allow the view */
50
-                if (! PreviewMode::fromRequest()->check()) {
51
-                    throw new NotFoundHttpException('Model found for request ['. $slug .'] but it is not published.');
50
+                if (!PreviewMode::fromRequest()->check()) {
51
+                    throw new NotFoundHttpException('Model found for request ['.$slug.'] but it is not published.');
52 52
                 }
53 53
             }
54 54
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             }
60 60
         }
61 61
 
62
-        throw new NotFoundHttpException('No url or model found for request ['. $slug .'] for locale ['.$locale.'].');
62
+        throw new NotFoundHttpException('No url or model found for request ['.$slug.'] for locale ['.$locale.'].');
63 63
     }
64 64
 
65 65
     private static function createRedirect(string $url)
Please login to merge, or discard this patch.
src/Urls/UrlHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     private static function onlineModels(bool $onlySingles = false, Model $ignoredModel = null): Collection
41 41
     {
42
-        $models = chiefMemoize('all-online-models', function () use ($onlySingles) {
42
+        $models = chiefMemoize('all-online-models', function() use ($onlySingles) {
43 43
             $builder = UrlRecord::whereNull('redirect_id')
44 44
                 ->select('model_type', 'model_id')
45 45
                 ->groupBy('model_type', 'model_id');
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
                 $builder->where('model_type', 'singles');
49 49
             }
50 50
 
51
-            return $builder->get()->mapToGroups(function ($record) {
51
+            return $builder->get()->mapToGroups(function($record) {
52 52
                 return [$record->model_type => $record->model_id];
53
-            })->map(function ($record, $key) {
53
+            })->map(function($record, $key) {
54 54
                 return Morphables::instance($key)->find($record->toArray());
55
-            })->map->reject(function ($model) {
55
+            })->map->reject(function($model) {
56 56
                 return is_null($model) || !$model->isPublished(); // Invalid references to archived or removed models where url record still exists.
57 57
             })->flatten();
58 58
         }, [$onlySingles]);
59 59
 
60 60
         if ($ignoredModel) {
61
-            $models = $models->reject(function ($model) use ($ignoredModel) {
61
+            $models = $models->reject(function($model) use ($ignoredModel) {
62 62
                 return (get_class($model) === get_class($ignoredModel) && $model->id === $ignoredModel->id);
63 63
             });
64 64
         }
Please login to merge, or discard this patch.