Passed
Push — ft/states ( 7f21b4...728e57 )
by Ben
08:08
created
src/Filters/Filters.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $requestInput = request()->all();
39 39
 
40
-        return array_reduce($this->all(), function ($carry, Filter $filter) use ($requestInput) {
41
-            return $carry . $filter->render($requestInput);
40
+        return array_reduce($this->all(), function($carry, Filter $filter) use ($requestInput) {
41
+            return $carry.$filter->render($requestInput);
42 42
         }, '');
43 43
     }
44 44
 
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function keys(): array
56 56
     {
57
-        return array_map(function (Filter $filter) {
57
+        return array_map(function(Filter $filter) {
58 58
             return $filter->key();
59 59
         }, $this->filters);
60 60
     }
61 61
 
62 62
     private function validateFilters(array $filters)
63 63
     {
64
-        array_map(function (Filter $filter) {
64
+        array_map(function(Filter $filter) {
65 65
         }, $filters);
66 66
     }
67 67
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 
87 87
     public function offsetSet($offset, $value)
88 88
     {
89
-        if (! $value instanceof Filter) {
90
-            throw new \InvalidArgumentException('Passed value must be of type ' . Filter::class);
89
+        if (!$value instanceof Filter) {
90
+            throw new \InvalidArgumentException('Passed value must be of type '.Filter::class);
91 91
         }
92 92
 
93 93
         $this->filters[$offset] = $value;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
     private function sanitizeFilters(array $filters)
107 107
     {
108
-        return array_map(function ($filter) {
108
+        return array_map(function($filter) {
109 109
             if (is_string($filter) && class_exists($filter)) {
110 110
                 return $filter::init();
111 111
             }
Please login to merge, or discard this patch.
src/Filters/Types/SelectFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
     public function apply($value = null): Closure
17 17
     {
18
-        return $this->query && $this->query instanceof Closure ? $this->query : function ($query) {
18
+        return $this->query && $this->query instanceof Closure ? $this->query : function($query) {
19 19
             return $query;
20 20
         };
21 21
     }
Please login to merge, or discard this patch.
src/Filters/Types/FilterType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 
7 7
 class FilterType
8 8
 {
9
-    const INPUT = 'input';   // oneliner text (input)
10
-    const SELECT = 'select';  // Select options
9
+    const INPUT = 'input'; // oneliner text (input)
10
+    const SELECT = 'select'; // Select options
11 11
 
12 12
     /**
13 13
      * @var string
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
             static::INPUT,
21 21
             static::SELECT,
22 22
         ])) {
23
-            throw new \Exception('Invalid type identifier given [' . $type . '].');
23
+            throw new \Exception('Invalid type identifier given ['.$type.'].');
24 24
         }
25 25
 
26 26
         $this->type = $type;
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
     public static function fromString(string $type)
30 30
     {
31
-        $class = 'Thinktomorrow\Chief\Filters\Types\\' . ucfirst($type . 'Filter');
31
+        $class = 'Thinktomorrow\Chief\Filters\Types\\'.ucfirst($type.'Filter');
32 32
 
33 33
         return new $class(new static($type));
34 34
     }
Please login to merge, or discard this patch.
src/Management/Exceptions/NotAllowedManagerRoute.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@
 block discarded – undo
39 39
 
40 40
     public static function notAllowedVerb($verb, Manager $manager)
41 41
     {
42
-        throw new static('Not allowed to '.$verb.' a model. '.ucfirst($verb).' route is not allowed by the ' . $manager->details()->key.' manager.');
42
+        throw new static('Not allowed to '.$verb.' a model. '.ucfirst($verb).' route is not allowed by the '.$manager->details()->key.' manager.');
43 43
     }
44 44
 
45 45
     public static function notAllowedPermission($permission, Manager $manager)
46 46
     {
47
-        throw new static('Not allowed permission for '.$permission.' on a model as managed by the ' . $manager->details()->key.' manager.');
47
+        throw new static('Not allowed permission for '.$permission.' on a model as managed by the '.$manager->details()->key.' manager.');
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
src/Management/Details/Details.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 
65 65
     public function __toString()
66 66
     {
67
-        return (string) $this->get('key');
67
+        return (string)$this->get('key');
68 68
     }
69 69
 
70 70
     /**
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/FieldArrangement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 
48 48
     private function validateTabs(array $tabs)
49 49
     {
50
-        array_map(function (FieldsTab $tab) {
50
+        array_map(function(FieldsTab $tab) {
51 51
         }, $tabs);
52 52
     }
53 53
 
Please login to merge, or discard this patch.
src/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/Concerns/Morphable/Morphable.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     public function scopeMorphable($query, string $morphkey = null)
33 33
     {
34 34
         return $query->withoutGlobalScope(static::globalMorphableScope())
35
-                     ->where('morph_key', '=', $morphkey);
35
+                        ->where('morph_key', '=', $morphkey);
36 36
     }
37 37
 
38 38
     /**
Please login to merge, or discard this patch.