@@ -36,13 +36,13 @@ |
||
36 | 36 | return $this; |
37 | 37 | } |
38 | 38 | |
39 | - $this->label = is_array($this->label)? $this->label: [$this->label]; |
|
39 | + $this->label = is_array($this->label) ? $this->label : [$this->label]; |
|
40 | 40 | |
41 | 41 | $this->label = array_map('trans', $this->label); |
42 | 42 | |
43 | - $this->location = is_array($this->location)? $this->location: [$this->location]; |
|
43 | + $this->location = is_array($this->location) ? $this->location : [$this->location]; |
|
44 | 44 | |
45 | - return array_merge($this->label, $this->location?: []); |
|
45 | + return array_merge($this->label, $this->location ?: []); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function label($label) |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | $defaultView = self::module()::view(); |
21 | 21 | |
22 | - $viewClass = is_a(static::class, ModuleView::class, true)? static::class: $defaultView; |
|
22 | + $viewClass = is_a(static::class, ModuleView::class, true) ? static::class : $defaultView; |
|
23 | 23 | |
24 | 24 | if ($viewClass == $defaultView) $viewClass = null; |
25 | 25 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | final public static function moduleLink($module, $method = 'body', $args = []) |
40 | 40 | { |
41 | - $alias = class_exists($module)? $module::alias(): $module; |
|
41 | + $alias = class_exists($module) ? $module::alias() : $module; |
|
42 | 42 | |
43 | 43 | return url(implode('/', ['view', $alias, $method, self::encodeArgs($args)])); |
44 | 44 | } |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | * @throws \Illuminate\Http\Exceptions\HttpResponseException |
53 | 53 | */ |
54 | 54 | final public static function decodeArgs($hash) { |
55 | - if (! $hash) return []; |
|
55 | + if (!$hash) return []; |
|
56 | 56 | |
57 | 57 | $args = session($hash); |
58 | 58 | |
59 | 59 | if (is_null($args)) abort(419); |
60 | 60 | |
61 | - return is_array($args)? $args: [$args]; |
|
61 | + return is_array($args) ? $args : [$args]; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | * @return string |
69 | 69 | */ |
70 | 70 | final public static function encodeArgs($args) { |
71 | - $args = is_array($args)? $args: [$args]; |
|
71 | + $args = is_array($args) ? $args : [$args]; |
|
72 | 72 | |
73 | - if (! $args) return; |
|
73 | + if (!$args) return; |
|
74 | 74 | |
75 | 75 | $hash = md5(serialize($args)); |
76 | 76 |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | |
22 | 22 | $viewClass = is_a(static::class, ModuleView::class, true)? static::class: $defaultView; |
23 | 23 | |
24 | - if ($viewClass == $defaultView) $viewClass = null; |
|
24 | + if ($viewClass == $defaultView) { |
|
25 | + $viewClass = null; |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return url(implode('/', ['view', implode('_', array_filter([self::alias(), $viewClass])), $method, self::encodeArgs($args)])); |
27 | 29 | } |
@@ -52,11 +54,15 @@ discard block |
||
52 | 54 | * @throws \Illuminate\Http\Exceptions\HttpResponseException |
53 | 55 | */ |
54 | 56 | final public static function decodeArgs($hash) { |
55 | - if (! $hash) return []; |
|
57 | + if (! $hash) { |
|
58 | + return []; |
|
59 | + } |
|
56 | 60 | |
57 | 61 | $args = session($hash); |
58 | 62 | |
59 | - if (is_null($args)) abort(419); |
|
63 | + if (is_null($args)) { |
|
64 | + abort(419); |
|
65 | + } |
|
60 | 66 | |
61 | 67 | return is_array($args)? $args: [$args]; |
62 | 68 | } |
@@ -70,7 +76,9 @@ discard block |
||
70 | 76 | final public static function encodeArgs($args) { |
71 | 77 | $args = is_array($args)? $args: [$args]; |
72 | 78 | |
73 | - if (! $args) return; |
|
79 | + if (! $args) { |
|
80 | + return; |
|
81 | + } |
|
74 | 82 | |
75 | 83 | $hash = md5(serialize($args)); |
76 | 84 |
@@ -6,16 +6,16 @@ |
||
6 | 6 | { |
7 | 7 | public function notify($options, $attachTo = null) |
8 | 8 | { |
9 | - $options = array_merge(['duration'=> 1500], is_array($options)? $options: ['content' => $options]); |
|
9 | + $options = array_merge(['duration'=> 1500], is_array($options) ? $options : ['content' => $options]); |
|
10 | 10 | |
11 | - $attachTo = $attachTo?: $this; |
|
11 | + $attachTo = $attachTo ?: $this; |
|
12 | 12 | |
13 | 13 | return (new \atk4\ui\jsNotify($options, $attachTo)); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function notifyError($options, $attachTo = null) |
17 | 17 | { |
18 | - $options = array_merge(['color' => 'red'], is_array($options)? $options: ['content' => $options]); |
|
18 | + $options = array_merge(['color' => 'red'], is_array($options) ? $options : ['content' => $options]); |
|
19 | 19 | |
20 | 20 | return $this->notify($options, $attachTo); |
21 | 21 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | final public static function packageManifest() |
13 | 13 | { |
14 | - return self::$packageManifest = self::$packageManifest?: new PackageManifest(new Filesystem(), app()->basePath(), self::getCachedManifestPath()); |
|
14 | + return self::$packageManifest = self::$packageManifest ?: new PackageManifest(new Filesystem(), app()->basePath(), self::getCachedManifestPath()); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | final public static function getCachedManifestPath() |
@@ -12,11 +12,11 @@ |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | final public static function requireJS($file = 'default.js', $isAsync = false, $isDefer = false) { |
15 | - return epesi()->requireJS(self::assetUrl('js/'. $file), $isAsync, $isDefer); |
|
15 | + return epesi()->requireJS(self::assetUrl('js/' . $file), $isAsync, $isDefer); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | final public static function requireCSS($file = 'default.css') { |
19 | - return epesi()->requireCSS(self::assetUrl('css/'. $file)); |
|
19 | + return epesi()->requireCSS(self::assetUrl('css/' . $file)); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | */ |
15 | 15 | final public static function view($alias = null) |
16 | 16 | { |
17 | - $class = self::namespace() . '\\' . ($alias? Str::studly($alias): self::name()) . 'View'; |
|
17 | + $class = self::namespace() . '\\' . ($alias ? Str::studly($alias) : self::name()) . 'View'; |
|
18 | 18 | |
19 | 19 | if ($alias) return $class; |
20 | 20 | |
21 | - return static::$view?: $class; |
|
21 | + return static::$view ?: $class; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $names = array_slice(explode('\\', static::class), -2, -1); |
66 | 66 | |
67 | - return $names? reset($names): ''; |
|
67 | + return $names ? reset($names) : ''; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -16,7 +16,9 @@ |
||
16 | 16 | { |
17 | 17 | $class = self::namespace() . '\\' . ($alias? Str::studly($alias): self::name()) . 'View'; |
18 | 18 | |
19 | - if ($alias) return $class; |
|
19 | + if ($alias) { |
|
20 | + return $class; |
|
21 | + } |
|
20 | 22 | |
21 | 23 | return static::$view?: $class; |
22 | 24 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $link = $this->link(); |
35 | 35 | |
36 | - $link = is_array($link)? ModuleView::moduleLink(...$link): $link; |
|
36 | + $link = is_array($link) ? ModuleView::moduleLink(...$link) : $link; |
|
37 | 37 | |
38 | 38 | return (new LaunchButton([ |
39 | 39 | 'label' => $this->label(), |
@@ -137,7 +137,9 @@ |
||
137 | 137 | $form->addField('create', ['Checkbox', 'caption' => __('Create New Database')])->on('change', new jsExpression('if ($(event.target).is(":checked")) alert([])', [__('WARNING: Make sure you have CREATE access level to do this!')])); |
138 | 138 | |
139 | 139 | foreach ($wizard->recall('connection', []) as $name => $value) { |
140 | - if (! $field = $form->fields[$name]?? null) continue; |
|
140 | + if (! $field = $form->fields[$name]?? null) { |
|
141 | + continue; |
|
142 | + } |
|
141 | 143 | |
142 | 144 | $field->set($value); |
143 | 145 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $column = $columns->addColumn(); |
73 | 73 | |
74 | - if (! function_exists('locale_get_display_language')) { |
|
74 | + if (!function_exists('locale_get_display_language')) { |
|
75 | 75 | $column->addClass('middle aligned'); |
76 | 76 | $column->add(['Label', __('Install php-intl extension to enable language selection!'), 'class' => ['red']]); |
77 | 77 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $form->addField('language', ['DropDown', 'values' => $values, 'caption' => __('Select Language'), 'iconLeft' => 'globe'], ['required'=>true])->set($wizard->recall('language', 'en')); |
88 | 88 | |
89 | - $form->onSubmit(function ($form) use ($wizard) { |
|
89 | + $form->onSubmit(function($form) use ($wizard) { |
|
90 | 90 | $wizard->memorize('language', $form->model['language']); |
91 | 91 | |
92 | 92 | App::setLocale($form->model['language']); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $form->addField('support', ['Checkbox', 'caption' => __('I will not remove "Support -> About" credit page from the application menu.')], ['required'=>true]); |
119 | 119 | $form->addField('store', ['Checkbox', 'caption' => __('I will not remove or rename ":epesi Store" links from the application.', ['epesi' => config('epesi.app.title')])], ['required'=>true]); |
120 | 120 | |
121 | - $form->onSubmit(function ($form) use ($wizard) { |
|
121 | + $form->onSubmit(function($form) use ($wizard) { |
|
122 | 122 | return $wizard->jsNext(); |
123 | 123 | }); |
124 | 124 | |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | $form->addField('create', ['Checkbox', 'caption' => __('Create New Database')])->on('change', new jsExpression('if ($(event.target).is(":checked")) alert([])', [__('WARNING: Make sure you have CREATE access level to do this!')])); |
147 | 147 | |
148 | 148 | foreach ($wizard->recall('connection', []) as $name => $value) { |
149 | - if (! $field = $form->fields[$name]?? null) continue; |
|
149 | + if (!$field = $form->fields[$name]?? null) continue; |
|
150 | 150 | |
151 | 151 | $field->set($value); |
152 | 152 | } |
153 | 153 | |
154 | - $form->onSubmit(function ($form) use ($wizard) { |
|
154 | + $form->onSubmit(function($form) use ($wizard) { |
|
155 | 155 | $connection = $form->model->get(); |
156 | 156 | |
157 | 157 | $wizard->memorize('connection', $connection); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | $form->setValues($wizard->recall('user')); |
201 | 201 | |
202 | - $form->validate(function ($form) use ($wizard) { |
|
202 | + $form->validate(function($form) use ($wizard) { |
|
203 | 203 | $wizard->memorize('user', $form->model->get()); |
204 | 204 | |
205 | 205 | return $wizard->jsNext(); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | private static $variables; |
18 | 18 | |
19 | 19 | private static function cache() { |
20 | - if(isset(self::$variables)) return; |
|
20 | + if (isset(self::$variables)) return; |
|
21 | 21 | |
22 | 22 | self::$variables = self::pluck('value', 'name'); |
23 | 23 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public static function get($name, $throwError = true) { |
26 | 26 | self::cache(); |
27 | 27 | |
28 | - if (! self::$variables->has($name) && $throwError) { |
|
28 | + if (!self::$variables->has($name) && $throwError) { |
|
29 | 29 | throw new \Exception('No such variable in database: ' . $name); |
30 | 30 | } |
31 | 31 | |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | return self::updateOrCreate(compact('name'), compact('value')); |
47 | 47 | } |
48 | 48 | |
49 | - public static function forget($name, $throwError=true) { |
|
49 | + public static function forget($name, $throwError = true) { |
|
50 | 50 | self::cache(); |
51 | 51 | |
52 | - if (! self::$variables->has($name) && $throwError) { |
|
52 | + if (!self::$variables->has($name) && $throwError) { |
|
53 | 53 | throw new \Exception('No such variable in database: ' . $name); |
54 | 54 | } |
55 | 55 |
@@ -17,7 +17,9 @@ |
||
17 | 17 | private static $variables; |
18 | 18 | |
19 | 19 | private static function cache() { |
20 | - if(isset(self::$variables)) return; |
|
20 | + if(isset(self::$variables)) { |
|
21 | + return; |
|
22 | + } |
|
21 | 23 | |
22 | 24 | self::$variables = self::pluck('value', 'name'); |
23 | 25 | } |