We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | * - when true: `address[street]` |
20 | 20 | * - when false: `[address][street]` |
21 | 21 | */ |
22 | -if (! Str::hasMacro('dotsToSquareBrackets')) { |
|
23 | - Str::macro('dotsToSquareBrackets', function ($string, $ignore = [], $keyFirst = true) { |
|
22 | +if (!Str::hasMacro('dotsToSquareBrackets')) { |
|
23 | + Str::macro('dotsToSquareBrackets', function($string, $ignore = [], $keyFirst = true) { |
|
24 | 24 | $stringParts = explode('.', $string); |
25 | 25 | $result = ''; |
26 | 26 | |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | return $result; |
35 | 35 | }); |
36 | 36 | } |
37 | -if (! CrudColumn::hasMacro('withFiles')) { |
|
38 | - CrudColumn::macro('withFiles', function ($uploadDefinition = [], $subfield = null, $registerUploaderEvents = true) { |
|
37 | +if (!CrudColumn::hasMacro('withFiles')) { |
|
38 | + CrudColumn::macro('withFiles', function($uploadDefinition = [], $subfield = null, $registerUploaderEvents = true) { |
|
39 | 39 | /** @var CrudField|CrudColumn $this */ |
40 | 40 | RegisterUploadEvents::handle($this, $uploadDefinition, 'withFiles', $subfield, $registerUploaderEvents); |
41 | 41 | |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | }); |
44 | 44 | } |
45 | 45 | |
46 | -if (! CrudField::hasMacro('withFiles')) { |
|
47 | - CrudField::macro('withFiles', function ($uploadDefinition = [], $subfield = null, $registerUploaderEvents = true) { |
|
46 | +if (!CrudField::hasMacro('withFiles')) { |
|
47 | + CrudField::macro('withFiles', function($uploadDefinition = [], $subfield = null, $registerUploaderEvents = true) { |
|
48 | 48 | /** @var CrudField|CrudColumn $this */ |
49 | 49 | RegisterUploadEvents::handle($this, $uploadDefinition, 'withFiles', $subfield, $registerUploaderEvents); |
50 | 50 | |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | if (!CrudColumn::hasMacro('linkTo')) { |
56 | - CrudColumn::macro('linkTo', function ($route, $target = null) { |
|
56 | + CrudColumn::macro('linkTo', function($route, $target = null) { |
|
57 | 57 | |
58 | - $wrapper = $this->attributes['wrapper'] ?? []; |
|
59 | - if (in_array($this->attributes['type'], ['select','select_grouped','select2','select2_grouped','select2_nested','select2_from_ajax'])) { |
|
60 | - $wrapper['href'] = function ($crud, $column, $entry, $related_key) use ($route) { |
|
58 | + $wrapper = $this->attributes['wrapper'] ?? []; |
|
59 | + if (in_array($this->attributes['type'], ['select', 'select_grouped', 'select2', 'select2_grouped', 'select2_nested', 'select2_from_ajax'])) { |
|
60 | + $wrapper['href'] = function($crud, $column, $entry, $related_key) use ($route) { |
|
61 | 61 | return route($route, $related_key); |
62 | 62 | }; |
63 | 63 | } else { |
64 | - $wrapper['href'] = function ($crud,$column,$entry) use ($route) { |
|
64 | + $wrapper['href'] = function($crud, $column, $entry) use ($route) { |
|
65 | 65 | return url($route.$column["value"]); |
66 | 66 | }; |
67 | 67 | } |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | * |
81 | 81 | * It will go to the given CrudController and get the setupRoutes() method on it. |
82 | 82 | */ |
83 | -if (! Route::hasMacro('crud')) { |
|
84 | - Route::macro('crud', function ($name, $controller) { |
|
83 | +if (!Route::hasMacro('crud')) { |
|
84 | + Route::macro('crud', function($name, $controller) { |
|
85 | 85 | // put together the route name prefix, |
86 | 86 | // as passed to the Route::group() statements |
87 | 87 | $routeName = ''; |
@@ -66,8 +66,9 @@ |
||
66 | 66 | }; |
67 | 67 | } |
68 | 68 | |
69 | - if ($target) |
|
70 | - $wrapper['target'] = $target; |
|
69 | + if ($target) { |
|
70 | + $wrapper['target'] = $target; |
|
71 | + } |
|
71 | 72 | |
72 | 73 | $this->wrapper($wrapper); |
73 | 74 | return $this; |