@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | // Constraints |
| 38 | 38 | if (!isset($values['action'])) { |
| 39 | - throw new \InvalidArgumentException('Set reference array is missing required values for the "action" keys. Given: ' . print_r($values, true)); |
|
| 39 | + throw new \InvalidArgumentException('Set reference array is missing required values for the "action" keys. Given: '.print_r($values, true)); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return new static( |
@@ -51,14 +51,14 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | $sets = config('thinktomorrow.chief.sets', []); |
| 53 | 53 | |
| 54 | - return collect($sets)->map(function ($set, $key) { |
|
| 54 | + return collect($sets)->map(function($set, $key) { |
|
| 55 | 55 | return SetReference::fromArray($key, $set); |
| 56 | 56 | }); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public static function find($key): ?SetReference |
| 60 | 60 | { |
| 61 | - return static::all()->filter(function ($ref) use ($key) { |
|
| 61 | + return static::all()->filter(function($ref) use ($key) { |
|
| 62 | 62 | return $ref->key() == $key; |
| 63 | 63 | })->first(); |
| 64 | 64 | } |
@@ -75,12 +75,12 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $this->validateAction($class, $method); |
| 77 | 77 | |
| 78 | - $result = call_user_func_array([app($class),$method], array_merge($this->parameters, [ |
|
| 78 | + $result = call_user_func_array([app($class), $method], array_merge($this->parameters, [ |
|
| 79 | 79 | 'parent' => $parent, |
| 80 | 80 | 'request' => request(), |
| 81 | 81 | ])); |
| 82 | 82 | |
| 83 | - if (! $result instanceof Set && $result instanceof Collection) { |
|
| 83 | + if (!$result instanceof Set && $result instanceof Collection) { |
|
| 84 | 84 | return new Set($result->all(), $this->key); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | private static function validateAction($class, $method) |
| 114 | 114 | { |
| 115 | - if (! class_exists($class)) { |
|
| 115 | + if (!class_exists($class)) { |
|
| 116 | 116 | throw new \InvalidArgumentException('The class ['.$class.'] isn\'t a valid class reference or does not exist in the chief-settings.sets config entry.'); |
| 117 | 117 | } |
| 118 | 118 | |