Completed
Push — 0.3 ( da43ab...625b56 )
by Ben
96:17 queued 52:29
created
src/Management/Details/HasDetails.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         $internal_label = contract($this->model, ProvidesFlatReference::class) ? $this->model->flatReferenceLabel() : $key;
22 22
 
23 23
         // Manager index and header info
24
-        $title = $this->model->title ?? ($this->model->id ? $labelSingular . ' ' . $this->model->id : $labelSingular);
24
+        $title = $this->model->title ?? ($this->model->id ? $labelSingular.' '.$this->model->id : $labelSingular);
25 25
 
26 26
         return new Details(
27 27
             $id,
Please login to merge, or discard this patch.
src/Management/Managers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $registrations = collect($this->register->filterByTag($tag)->all());
52 52
 
53
-        return $registrations->map(function ($registration) {
53
+        return $registrations->map(function($registration) {
54 54
             return $this->instance($registration);
55 55
         });
56 56
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $registrations = collect($this->register->filterByTag($tag)->all());
67 67
 
68
-        return $registrations->map(function ($registration) {
68
+        return $registrations->map(function($registration) {
69 69
             return $this->instance($registration)->details();
70 70
         });
71 71
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         //return array with group name and values
77 77
         $grouped = [];
78 78
 
79
-        $managers = $managers->map(function (Manager $item) {
79
+        $managers = $managers->map(function(Manager $item) {
80 80
             return [
81 81
                 'id'    => $item->details()->id,
82 82
                 'group' => $item->details()->plural,
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $registrations = collect($this->register->all());
92 92
 
93
-        return $registrations->map(function ($registration) {
93
+        return $registrations->map(function($registration) {
94 94
             return $this->instance($registration);
95 95
         });
96 96
     }
Please login to merge, or discard this patch.
src/Management/Registration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
         }
84 84
 
85 85
         $manager = new \ReflectionClass($this->managerClass);
86
-        if (! $manager->implementsInterface(Manager::class)) {
86
+        if (!$manager->implementsInterface(Manager::class)) {
87 87
             throw new \InvalidArgumentException('Class ['.$this->managerClass.'] is expected to implement the ['.Manager::class.'] contract.');
88 88
         }
89 89
     }
Please login to merge, or discard this patch.
src/Management/ManagesPagebuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         
49 49
         $availableChildren = AvailableChildren::forParent($model);
50 50
         
51
-        $modules = $availableChildren->onlyModules()->reject(function ($module) use ($model) {
51
+        $modules = $availableChildren->onlyModules()->reject(function($module) use ($model) {
52 52
             return $module->page_id != null && $module->page_id != $model->id;
53 53
         });
54 54
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $available_sets = FlatReferencePresenter::toGroupedSelectValues($availableChildren->onlySets())->toArray();
58 58
 
59 59
         // Current sections
60
-        $sections = $model->children()->map(function ($section, $index) {
60
+        $sections = $model->children()->map(function($section, $index) {
61 61
             if ($section instanceof TranslatableContract) {
62 62
                 $section->injectTranslationForForm();
63 63
             }
Please login to merge, or discard this patch.
src/Management/Register.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function filter(callable $callback): self
48 48
     {
49
-        if (! is_callable($callback)) {
49
+        if (!is_callable($callback)) {
50 50
             return new static($this->registrations);
51 51
         }
52 52
 
53 53
         $registrations = $this->registrations;
54 54
 
55 55
         foreach ($registrations as $k => $registration) {
56
-            if (!! call_user_func($callback, $registration)) {
56
+            if (!!call_user_func($callback, $registration)) {
57 57
                 unset($registrations[$k]);
58 58
             }
59 59
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function filterByTag($tag): self
80 80
     {
81 81
         try {
82
-            return $this->filterBy('tags', (array) $tag);
82
+            return $this->filterBy('tags', (array)$tag);
83 83
         } catch (NonRegisteredManager $e) {
84 84
             return new static();
85 85
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         foreach ($registrations as $k => $registration) {
108 108
             $containsValue = $registration->has($key, $value);
109 109
 
110
-            if ($type == 'filter' && ! $containsValue) {
110
+            if ($type == 'filter' && !$containsValue) {
111 111
                 unset($registrations[$k]);
112 112
             }
113 113
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     private function registrationMustExistConstraint(string $key, $value, $registrations): void
137 137
     {
138 138
         if (empty($registrations) && count($registrations) != $this->registrations) {
139
-            throw new NonRegisteredManager('No manager found for ' . $key . ' [' . print_r($value, true) . ']. Did you perhaps forgot to register the manager?');
139
+            throw new NonRegisteredManager('No manager found for '.$key.' ['.print_r($value, true).']. Did you perhaps forgot to register the manager?');
140 140
         }
141 141
     }
142 142
 }
Please login to merge, or discard this patch.
src/Fields/LocalizedFieldValidationRules.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
                 // prepend the name with the expected trans.<locale>. string
28 28
                 $localizedAttr = (false !== strpos($attr, '*'))
29 29
                     ? str_replace('*', $locale, $attr)
30
-                    : 'trans.' . $locale . '.' . $attr;
30
+                    : 'trans.'.$locale.'.'.$attr;
31 31
 
32 32
                 $localizedRules[$localizedAttr] = $rule;
33 33
             }
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function influenceByPayload(array $data)
49 49
     {
50
-        if (! isset($data['trans'])) {
50
+        if (!isset($data['trans'])) {
51 51
             return $this;
52 52
         }
53 53
 
54 54
         // Remove locales that are considered empty in the request payload
55 55
         foreach ($data['trans'] as $locale => $values) {
56
-            if ($locale == $this->defaultLocale || ! is_array_empty($values)) {
56
+            if ($locale == $this->defaultLocale || !is_array_empty($values)) {
57 57
                 continue;
58 58
             }
59 59
 
Please login to merge, or discard this patch.
src/Fields/Types/SelectField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Thinktomorrow\Chief\Fields\Types;
5 5
 
Please login to merge, or discard this patch.
src/Fields/Types/PagebuilderField.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
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $value = parent::__get($key);
51 51
 
52 52
         // Default empty array for these following values
53
-        if (!$value && in_array($key, ['sections','availableModules','availablePages', 'availableSets'])) {
53
+        if (!$value && in_array($key, ['sections', 'availableModules', 'availablePages', 'availableSets'])) {
54 54
             return [];
55 55
         }
56 56
 
Please login to merge, or discard this patch.
src/Fields/Types/HtmlField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 namespace Thinktomorrow\Chief\Fields\Types;
4 4
 
5 5
 class HtmlField extends Field
Please login to merge, or discard this patch.