@@ -58,7 +58,7 @@ |
||
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 | } |
@@ -20,7 +20,7 @@ discard block |
||
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 |
||
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 |
@@ -20,7 +20,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | public static function toSelectValues(Collection $collection): Collection |
12 | 12 | { |
13 | - return $collection->map(function (ReferableModel $item) { |
|
13 | + return $collection->map(function(ReferableModel $item) { |
|
14 | 14 | return [ |
15 | 15 | 'id' => $item->modelReference()->get(), |
16 | 16 | 'label' => $item->modelReferenceLabel(), |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | { |
24 | 24 | $grouped = []; |
25 | 25 | |
26 | - static::toSelectValues($collection)->each(function ($item) use (&$grouped) { |
|
26 | + static::toSelectValues($collection)->each(function($item) use (&$grouped) { |
|
27 | 27 | if (isset($grouped[$item['group']])) { |
28 | 28 | $grouped[$item['group']]['values'][] = $item; |
29 | - } else { |
|
29 | + }else { |
|
30 | 30 | $grouped[$item['group']] = ['group' => $item['group'], 'values' => [$item]]; |
31 | 31 | } |
32 | 32 | }); |
@@ -21,16 +21,16 @@ |
||
21 | 21 | $referenceStrings = []; |
22 | 22 | } |
23 | 23 | |
24 | - return (new Collection($referenceStrings))->reject(function ($referenceString) { |
|
24 | + return (new Collection($referenceStrings))->reject(function($referenceString) { |
|
25 | 25 | return is_null($referenceString); |
26 | - })->map(function ($referenceString) { |
|
26 | + })->map(function($referenceString) { |
|
27 | 27 | return ModelReference::fromString($referenceString)->instance(); |
28 | 28 | }); |
29 | 29 | } |
30 | 30 | |
31 | 31 | public function toModelReferences(): Collection |
32 | 32 | { |
33 | - return (new Collection($this->all()))->map(function (ReferableModel $item) { |
|
33 | + return (new Collection($this->all()))->map(function(ReferableModel $item) { |
|
34 | 34 | return $item->modelReference()->get(); |
35 | 35 | }); |
36 | 36 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | $cachableParameters = $this->convertToCachableParameters($parameters); |
21 | 21 | |
22 | - $cachekey = $this->baseKey . ':' . md5(implode('', $cachableParameters)); |
|
22 | + $cachekey = $this->baseKey.':'.md5(implode('', $cachableParameters)); |
|
23 | 23 | |
24 | 24 | if (isset(static::$cache[$cachekey])) { |
25 | 25 | return static::$cache[$cachekey]; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | foreach ($parameters as $key => $value) { |
39 | 39 | if ($value instanceof Model) { |
40 | - $parameters[$key] = get_class($value) . '@' . $value->id; |
|
40 | + $parameters[$key] = get_class($value).'@'.$value->id; |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | public function render(Collection $widgets): string |
14 | 14 | { |
15 | 15 | // Validate each entry as a valid widget object. |
16 | - $widgets->each(function(Widget $widget){}); |
|
16 | + $widgets->each(function(Widget $widget) {}); |
|
17 | 17 | |
18 | 18 | // Init new loop object |
19 | 19 | $this->loopsStack = []; $this->addLoop($widgets); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $this->incrementLoopIndices(); |
23 | 23 | $loop = $this->getLastLoop(); |
24 | 24 | |
25 | - return $carry . $widget->renderAdminWidget($loop, $widgets); |
|
25 | + return $carry.$widget->renderAdminWidget($loop, $widgets); |
|
26 | 26 | }, ''); |
27 | 27 | } |
28 | 28 | } |
@@ -11,13 +11,13 @@ |
||
11 | 11 | |
12 | 12 | private function __construct(array $widgets) |
13 | 13 | { |
14 | - array_map(function(Widget $widget){}, $widgets); |
|
14 | + array_map(function(Widget $widget) {}, $widgets); |
|
15 | 15 | $this->widgets = $widgets; |
16 | 16 | } |
17 | 17 | |
18 | 18 | public static function fromArray(array $widgetClasses): self |
19 | 19 | { |
20 | - return new static(array_map(function(string $widgetClass){ |
|
20 | + return new static(array_map(function(string $widgetClass) { |
|
21 | 21 | return app($widgetClass); |
22 | 22 | }, $widgetClasses)); |
23 | 23 | } |
@@ -26,15 +26,15 @@ |
||
26 | 26 | { |
27 | 27 | $abilities = ['view', 'create', 'update', 'delete']; |
28 | 28 | |
29 | - return array_map(function ($val) use ($scope) { |
|
30 | - return $val . '-' . $scope; |
|
29 | + return array_map(function($val) use ($scope) { |
|
30 | + return $val.'-'.$scope; |
|
31 | 31 | }, $abilities); |
32 | 32 | } |
33 | 33 | |
34 | 34 | public static function getPermissionsForIndex() |
35 | 35 | { |
36 | 36 | $permissions = $temp = []; |
37 | - self::all()->each(function ($permission) use (&$permissions, &$temp) { |
|
37 | + self::all()->each(function($permission) use (&$permissions, &$temp) { |
|
38 | 38 | $model = explode("_", $permission->name, 2)[1]; |
39 | 39 | $temp[$model][$permission->id] = explode("_", $permission->name, 2)[0]; |
40 | 40 | $permissions = $temp; |