Test Setup Failed
Pull Request — master (#4)
by
unknown
09:08
created
src/System/ModuleAdministration.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$accordion = \atk4\ui\Accordion::addTo($container, ['type' => ['styled', 'fluid'], 'settings' => ['animateChildren' => false]])->setStyle(['max-width' => '800px', 'margin-left' => 'auto', 'margin-right' => 'auto']);
43 43
 		
44 44
 		if ($container == $this) {
45
-		    $this->accordion = $accordion;
45
+			$this->accordion = $accordion;
46 46
 		}
47 47
 		
48 48
 		foreach ($modules as $moduleClass) {
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 			$message = ob_get_clean();
101 101
 			
102 102
 			return [
103
-			        $this->notifySuccess($message),
104
-			        new \atk4\ui\JsReload($this->accordion),
103
+					$this->notifySuccess($message),
104
+					new \atk4\ui\JsReload($this->accordion),
105 105
 			];
106 106
 		});
107 107
 		
@@ -152,14 +152,14 @@  discard block
 block discarded – undo
152 152
 		$button = \atk4\ui\Button::addTo($container, [__('Uninstall'), 'class' => ['red']]);
153 153
 	    
154 154
 		$callback = $uninstallCallback = \atk4\ui\JsCallback::addTo($button, ['confirm' => __('Are you sure you want to uninstall :module', ['module' => $moduleClass::label()])])->set(function() use ($moduleClass) {
155
-		    ob_start();
155
+			ob_start();
156 156
 			ModuleManager::uninstall($moduleClass);
157 157
 			
158 158
 			$message = ob_get_clean();
159 159
 			
160 160
 			return [
161
-			        $this->notifySuccess($message),
162
-			        new \atk4\ui\JsReload($this->accordion),
161
+					$this->notifySuccess($message),
162
+					new \atk4\ui\JsReload($this->accordion),
163 163
 			];
164 164
 		});
165 165
 		
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 	
195 195
 	public function addClearCacheButton()
196 196
 	{
197
-	    ActionBar::addItemButton([__('Clear Cache'), 'icon' => 'refresh', 'hint' => __('Clears module cache and re-discovers all available modules')])->callback(function($callback) {
197
+		ActionBar::addItemButton([__('Clear Cache'), 'icon' => 'refresh', 'hint' => __('Clears module cache and re-discovers all available modules')])->callback(function($callback) {
198 198
 			ModuleManager::clearCache();
199 199
 			
200 200
 			return [
201 201
 					new \atk4\ui\JsReload($this->accordion),
202
-			        $this->notifySuccess(__('Cache cleared!'))
202
+					$this->notifySuccess(__('Cache cleared!'))
203 203
 			];
204 204
 		});
205 205
 	}
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$modules = collect(ModuleManager::getAll());
32 32
 
33
-		return $modules->filter(function ($subModuleClass) use ($modules) {
34
-			return ! $modules->map(function($moduleClass){
33
+		return $modules->filter(function($subModuleClass) use ($modules) {
34
+			return !$modules->map(function($moduleClass) {
35 35
 				return $moduleClass::namespace();
36 36
 			})->contains($subModuleClass::parentNamespace());
37 37
 		})->sort();
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
 			$section->add($label, 'title')->setStyle('float', 'right');
67 67
 			
68
-			$submodules = collect(ModuleManager::getAll())->filter(function ($subModuleClass) use ($moduleClass) {
68
+			$submodules = collect(ModuleManager::getAll())->filter(function($subModuleClass) use ($moduleClass) {
69 69
 				return $subModuleClass::isSubModuleOf($moduleClass);
70 70
 			});
71 71
 			
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
 	
80 80
 	public function formatModuleInfo($moduleClass)
81 81
 	{
82
-		$moduleInfo = (array) ($moduleClass::info()?: __(' No details provided by author'));
82
+		$moduleInfo = (array) ($moduleClass::info() ?: __(' No details provided by author'));
83 83
 		
84 84
 		$ret = [];
85 85
 		foreach ($moduleInfo as $label => $text) {
86
-			$ret[] = (is_string($label)? "<strong>$label</strong>: ": '') . $text;
86
+			$ret[] = (is_string($label) ? "<strong>$label</strong>: " : '') . $text;
87 87
 		}
88 88
 		
89 89
 		return implode('<br>', $ret);
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
 					
124 124
 					$form = Form::addTo($view);
125 125
 					foreach ($recommended as $childModule) {
126
-						if (! ModuleManager::isAvailable($childModule)) continue;
126
+						if (!ModuleManager::isAvailable($childModule)) continue;
127 127
 						
128 128
 						$form->addControl($childModule::alias(), [\atk4\ui\Form\Control\Checkbox::class, 'caption' => $childModule::label()]);
129 129
 					}
130 130
 					
131
-					$form->onSubmit(function ($form) use ($moduleClass) {
131
+					$form->onSubmit(function($form) use ($moduleClass) {
132 132
 						ob_start();
133 133
 						ModuleManager::install($moduleClass, array_keys($form->getValues(), true));
134 134
 						
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 				}
138 138
 				
139 139
 				\atk4\ui\Button::addTo($view, [__('Install'), 'primary'])->on('click', [
140
-						isset($form)? $form->submit(): $installCallback
140
+						isset($form) ? $form->submit() : $installCallback
141 141
 				]);
142 142
 			});
143 143
 			
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			];
164 164
 		});
165 165
 		
166
-		if ($dependents = ModuleManager::listDependents()[$moduleClass]?? []) {
166
+		if ($dependents = ModuleManager::listDependents()[$moduleClass] ?? []) {
167 167
 			$modal = \atk4\ui\Modal::addTo($this, ['title' => __(':module Module Installation', ['module' => $moduleClass::label()])])->set(function($view) use ($moduleClass, $dependents, $uninstallCallback) {
168 168
 				$message = \atk4\ui\Message::addTo($view, [__('Module is required by following modules')]);
169 169
 					
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
 				$this->addUninstallButton($section, $moduleClass);
57 57
 				
58 58
 // 				$this->addReinstallButton($section, $moduleClass);
59
-			}
60
-			else {
59
+			} else {
61 60
 				$label = [\atk4\ui\Label::class, __('Available'), 'yellow'];
62 61
 				
63 62
 				$this->addInstallButton($section, $moduleClass);
@@ -69,7 +68,9 @@  discard block
 block discarded – undo
69 68
 				return $subModuleClass::isSubModuleOf($moduleClass);
70 69
 			});
71 70
 			
72
-			if ($submodules->isEmpty()) continue;
71
+			if ($submodules->isEmpty()) {
72
+				continue;
73
+			}
73 74
 			
74 75
 			$this->addAccordion($section, $submodules);
75 76
 		}
@@ -123,7 +124,9 @@  discard block
 block discarded – undo
123 124
 					
124 125
 					$form = Form::addTo($view);
125 126
 					foreach ($recommended as $childModule) {
126
-						if (! ModuleManager::isAvailable($childModule)) continue;
127
+						if (! ModuleManager::isAvailable($childModule)) {
128
+							continue;
129
+						}
127 130
 						
128 131
 						$form->addControl($childModule::alias(), [\atk4\ui\Form\Control\Checkbox::class, 'caption' => $childModule::label()]);
129 132
 					}
Please login to merge, or discard this patch.
src/System/Modules/ModuleView.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
 	final public function displayModuleContent($method, $args)
29 29
 	{
30 30
 		// if method not callbale abort to 'not found'
31
-		if (! is_callable([$this, $method])) abort(404);
31
+		if (!is_callable([$this, $method])) abort(404);
32 32
 		
33 33
 		// if user has no access abort 'no access'
34
-		if (! $this->access()) abort(401);
34
+		if (!$this->access()) abort(401);
35 35
 		
36 36
 		$args = $this->decodeArgs($args);
37 37
 		
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,10 +28,14 @@
 block discarded – undo
28 28
 	final public function displayModuleContent($method, $args)
29 29
 	{
30 30
 		// if method not callbale abort to 'not found'
31
-		if (! is_callable([$this, $method])) abort(404);
31
+		if (! is_callable([$this, $method])) {
32
+			abort(404);
33
+		}
32 34
 		
33 35
 		// if user has no access abort 'no access'
34
-		if (! $this->access()) abort(401);
36
+		if (! $this->access()) {
37
+			abort(401);
38
+		}
35 39
 		
36 40
 		$args = $this->decodeArgs($args);
37 41
 		
Please login to merge, or discard this patch.
src/System/Modules/Concerns/Notifies.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@
 block discarded – undo
4 4
 
5 5
 trait Notifies
6 6
 {
7
-    public function notify($options)
8
-    {
9
-        $options = array_merge(['duration'=> 1500], is_array($options)? $options: ['message' => $options]);
7
+	public function notify($options)
8
+	{
9
+		$options = array_merge(['duration'=> 1500], is_array($options)? $options: ['message' => $options]);
10 10
 
11
-        return new \atk4\ui\JsToast($options);
12
-    }
11
+		return new \atk4\ui\JsToast($options);
12
+	}
13 13
     
14
-    public function notifySuccess($options)
15
-    {
16
-        $options = array_merge(['class' => 'success'], is_array($options)? $options: ['message' => $options]);
14
+	public function notifySuccess($options)
15
+	{
16
+		$options = array_merge(['class' => 'success'], is_array($options)? $options: ['message' => $options]);
17 17
         
18
-        return $this->notify($options);
19
-    }
18
+		return $this->notify($options);
19
+	}
20 20
     
21
-    public function notifyError($options)
22
-    {
23
-        $options = array_merge(['class' => 'error'], is_array($options)? $options: ['message' => $options]);
21
+	public function notifyError($options)
22
+	{
23
+		$options = array_merge(['class' => 'error'], is_array($options)? $options: ['message' => $options]);
24 24
         
25
-        return $this->notify($options);
26
-    }
25
+		return $this->notify($options);
26
+	}
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,21 +6,21 @@
 block discarded – undo
6 6
 {
7 7
     public function notify($options)
8 8
     {
9
-        $options = array_merge(['duration'=> 1500], is_array($options)? $options: ['message' => $options]);
9
+        $options = array_merge(['duration'=> 1500], is_array($options) ? $options : ['message' => $options]);
10 10
 
11 11
         return new \atk4\ui\JsToast($options);
12 12
     }
13 13
     
14 14
     public function notifySuccess($options)
15 15
     {
16
-        $options = array_merge(['class' => 'success'], is_array($options)? $options: ['message' => $options]);
16
+        $options = array_merge(['class' => 'success'], is_array($options) ? $options : ['message' => $options]);
17 17
         
18 18
         return $this->notify($options);
19 19
     }
20 20
     
21 21
     public function notifyError($options)
22 22
     {
23
-        $options = array_merge(['class' => 'error'], is_array($options)? $options: ['message' => $options]);
23
+        $options = array_merge(['class' => 'error'], is_array($options) ? $options : ['message' => $options]);
24 24
         
25 25
         return $this->notify($options);
26 26
     }
Please login to merge, or discard this patch.
src/System/Modules/PackageManifest.php 2 patches
Indentation   +162 added lines, -162 removed lines patch added patch discarded remove patch
@@ -7,168 +7,168 @@
 block discarded – undo
7 7
 
8 8
 class PackageManifest
9 9
 {
10
-    /**
11
-     * The filesystem instance.
12
-     *
13
-     * @var \Illuminate\Filesystem\Filesystem
14
-     */
15
-    public $files;
16
-
17
-    /**
18
-     * The base path.
19
-     *
20
-     * @var string
21
-     */
22
-    public $basePath;
23
-
24
-    /**
25
-     * The vendor path.
26
-     *
27
-     * @var string
28
-     */
29
-    public $vendorPath;
30
-
31
-    /**
32
-     * The manifest path.
33
-     *
34
-     * @var string|null
35
-     */
36
-    public $manifestPath;
37
-
38
-    /**
39
-     * The loaded manifest array.
40
-     *
41
-     * @var array
42
-     */
43
-    public $manifest;
44
-
45
-    /**
46
-     * Create a new package manifest instance.
47
-     *
48
-     * @param  \Illuminate\Filesystem\Filesystem  $files
49
-     * @param  string  $basePath
50
-     * @param  string  $manifestPath
51
-     * @return void
52
-     */
53
-    public function __construct(Filesystem $files, $basePath, $manifestPath)
54
-    {
55
-        $this->files = $files;
56
-        $this->basePath = $basePath;
57
-        $this->manifestPath = $manifestPath;
58
-        $this->vendorPath = $basePath.'/vendor';
59
-    }
60
-
61
-    /**
62
-     * Get all of the integrator class names for all packages.
63
-     *
64
-     * @return array
65
-     */
66
-    public function joints()
67
-    {
68
-        return collect($this->getManifest())->flatMap(function ($configuration) {
69
-            return (array) ($configuration['joints'] ?? []);
70
-        })->filter()->all();
71
-    }
10
+	/**
11
+	 * The filesystem instance.
12
+	 *
13
+	 * @var \Illuminate\Filesystem\Filesystem
14
+	 */
15
+	public $files;
16
+
17
+	/**
18
+	 * The base path.
19
+	 *
20
+	 * @var string
21
+	 */
22
+	public $basePath;
23
+
24
+	/**
25
+	 * The vendor path.
26
+	 *
27
+	 * @var string
28
+	 */
29
+	public $vendorPath;
30
+
31
+	/**
32
+	 * The manifest path.
33
+	 *
34
+	 * @var string|null
35
+	 */
36
+	public $manifestPath;
37
+
38
+	/**
39
+	 * The loaded manifest array.
40
+	 *
41
+	 * @var array
42
+	 */
43
+	public $manifest;
44
+
45
+	/**
46
+	 * Create a new package manifest instance.
47
+	 *
48
+	 * @param  \Illuminate\Filesystem\Filesystem  $files
49
+	 * @param  string  $basePath
50
+	 * @param  string  $manifestPath
51
+	 * @return void
52
+	 */
53
+	public function __construct(Filesystem $files, $basePath, $manifestPath)
54
+	{
55
+		$this->files = $files;
56
+		$this->basePath = $basePath;
57
+		$this->manifestPath = $manifestPath;
58
+		$this->vendorPath = $basePath.'/vendor';
59
+	}
60
+
61
+	/**
62
+	 * Get all of the integrator class names for all packages.
63
+	 *
64
+	 * @return array
65
+	 */
66
+	public function joints()
67
+	{
68
+		return collect($this->getManifest())->flatMap(function ($configuration) {
69
+			return (array) ($configuration['joints'] ?? []);
70
+		})->filter()->all();
71
+	}
72 72
     
73
-    /**
74
-     * Get all of the module declared for all packages.
75
-     *
76
-     * @return array
77
-     */
78
-    public function modules()
79
-    {
80
-    	return collect($this->getManifest())->flatMap(function ($configuration, $package) {
81
-    		return array_map(function($moduleRelativePath) use ($package) {
82
-    			return str_ireplace('/', DIRECTORY_SEPARATOR, implode('/', [$this->vendorPath, $package, $moduleRelativePath]));
83
-    		}, (array) ($configuration['modules'] ?? []));
84
-    	})->filter()->all();
85
-    }
86
-
87
-    /**
88
-     * Get the current package manifest.
89
-     *
90
-     * @return array
91
-     */
92
-    protected function getManifest()
93
-    {
94
-        if (isset($this->manifest)) {
95
-            return $this->manifest;
96
-        }
97
-
98
-        if (! file_exists($this->manifestPath)) {
99
-            $this->build();
100
-        }
73
+	/**
74
+	 * Get all of the module declared for all packages.
75
+	 *
76
+	 * @return array
77
+	 */
78
+	public function modules()
79
+	{
80
+		return collect($this->getManifest())->flatMap(function ($configuration, $package) {
81
+			return array_map(function($moduleRelativePath) use ($package) {
82
+				return str_ireplace('/', DIRECTORY_SEPARATOR, implode('/', [$this->vendorPath, $package, $moduleRelativePath]));
83
+			}, (array) ($configuration['modules'] ?? []));
84
+		})->filter()->all();
85
+	}
86
+
87
+	/**
88
+	 * Get the current package manifest.
89
+	 *
90
+	 * @return array
91
+	 */
92
+	protected function getManifest()
93
+	{
94
+		if (isset($this->manifest)) {
95
+			return $this->manifest;
96
+		}
97
+
98
+		if (! file_exists($this->manifestPath)) {
99
+			$this->build();
100
+		}
101 101
         
102
-        return $this->manifest = file_exists($this->manifestPath) ?
103
-            $this->files->getRequire($this->manifestPath) : [];
104
-    }
105
-
106
-    /**
107
-     * Build the manifest and write it to disk.
108
-     *
109
-     * @return void
110
-     */
111
-    public function build()
112
-    {
113
-        $packages = [];
114
-
115
-        if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
116
-            $packages = json_decode($this->files->get($path), true);
117
-        }
118
-
119
-        $ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());
120
-
121
-        $this->write(collect($packages['packages'])->mapWithKeys(function ($package) {
122
-            return [$this->format($package['name']) => $package['extra']['epesi'] ?? []];
123
-        })->each(function ($configuration) use (&$ignore) {
124
-            $ignore = array_merge($ignore, $configuration['dont-discover'] ?? []);
125
-        })->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {
126
-            return $ignoreAll || in_array($package, $ignore);
127
-        })->filter()->all());
128
-    }
129
-
130
-    /**
131
-     * Format the given package name.
132
-     *
133
-     * @param  string  $package
134
-     * @return string
135
-     */
136
-    protected function format($package)
137
-    {
138
-        return str_replace($this->vendorPath.'/', '', $package);
139
-    }
140
-
141
-    /**
142
-     * Get all of the package names that should be ignored.
143
-     *
144
-     * @return array
145
-     */
146
-    protected function packagesToIgnore()
147
-    {
148
-        if (! file_exists($this->basePath.'/composer.json')) {
149
-            return [];
150
-        }
151
-
152
-        return json_decode(file_get_contents(
153
-            $this->basePath.'/composer.json'
154
-        ), true)['extra']['epesi']['dont-discover'] ?? [];
155
-    }
156
-
157
-    /**
158
-     * Write the given manifest array to disk.
159
-     *
160
-     * @param  array  $manifest
161
-     * @return void
162
-     * @throws \Exception
163
-     */
164
-    protected function write(array $manifest)
165
-    {
166
-        if (! is_writable(dirname($this->manifestPath))) {
167
-            throw new Exception('The '.dirname($this->manifestPath).' directory must be present and writable.');
168
-        }
169
-
170
-        $this->files->put(
171
-            $this->manifestPath, '<?php return '.var_export($manifest, true).';'
172
-        );
173
-    }
102
+		return $this->manifest = file_exists($this->manifestPath) ?
103
+			$this->files->getRequire($this->manifestPath) : [];
104
+	}
105
+
106
+	/**
107
+	 * Build the manifest and write it to disk.
108
+	 *
109
+	 * @return void
110
+	 */
111
+	public function build()
112
+	{
113
+		$packages = [];
114
+
115
+		if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
116
+			$packages = json_decode($this->files->get($path), true);
117
+		}
118
+
119
+		$ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());
120
+
121
+		$this->write(collect($packages['packages'])->mapWithKeys(function ($package) {
122
+			return [$this->format($package['name']) => $package['extra']['epesi'] ?? []];
123
+		})->each(function ($configuration) use (&$ignore) {
124
+			$ignore = array_merge($ignore, $configuration['dont-discover'] ?? []);
125
+		})->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {
126
+			return $ignoreAll || in_array($package, $ignore);
127
+		})->filter()->all());
128
+	}
129
+
130
+	/**
131
+	 * Format the given package name.
132
+	 *
133
+	 * @param  string  $package
134
+	 * @return string
135
+	 */
136
+	protected function format($package)
137
+	{
138
+		return str_replace($this->vendorPath.'/', '', $package);
139
+	}
140
+
141
+	/**
142
+	 * Get all of the package names that should be ignored.
143
+	 *
144
+	 * @return array
145
+	 */
146
+	protected function packagesToIgnore()
147
+	{
148
+		if (! file_exists($this->basePath.'/composer.json')) {
149
+			return [];
150
+		}
151
+
152
+		return json_decode(file_get_contents(
153
+			$this->basePath.'/composer.json'
154
+		), true)['extra']['epesi']['dont-discover'] ?? [];
155
+	}
156
+
157
+	/**
158
+	 * Write the given manifest array to disk.
159
+	 *
160
+	 * @param  array  $manifest
161
+	 * @return void
162
+	 * @throws \Exception
163
+	 */
164
+	protected function write(array $manifest)
165
+	{
166
+		if (! is_writable(dirname($this->manifestPath))) {
167
+			throw new Exception('The '.dirname($this->manifestPath).' directory must be present and writable.');
168
+		}
169
+
170
+		$this->files->put(
171
+			$this->manifestPath, '<?php return '.var_export($manifest, true).';'
172
+		);
173
+	}
174 174
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $this->files = $files;
56 56
         $this->basePath = $basePath;
57 57
         $this->manifestPath = $manifestPath;
58
-        $this->vendorPath = $basePath.'/vendor';
58
+        $this->vendorPath = $basePath . '/vendor';
59 59
     }
60 60
 
61 61
     /**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function joints()
67 67
     {
68
-        return collect($this->getManifest())->flatMap(function ($configuration) {
68
+        return collect($this->getManifest())->flatMap(function($configuration) {
69 69
             return (array) ($configuration['joints'] ?? []);
70 70
         })->filter()->all();
71 71
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function modules()
79 79
     {
80
-    	return collect($this->getManifest())->flatMap(function ($configuration, $package) {
80
+    	return collect($this->getManifest())->flatMap(function($configuration, $package) {
81 81
     		return array_map(function($moduleRelativePath) use ($package) {
82 82
     			return str_ireplace('/', DIRECTORY_SEPARATOR, implode('/', [$this->vendorPath, $package, $moduleRelativePath]));
83 83
     		}, (array) ($configuration['modules'] ?? []));
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             return $this->manifest;
96 96
         }
97 97
 
98
-        if (! file_exists($this->manifestPath)) {
98
+        if (!file_exists($this->manifestPath)) {
99 99
             $this->build();
100 100
         }
101 101
         
@@ -112,17 +112,17 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $packages = [];
114 114
 
115
-        if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
115
+        if ($this->files->exists($path = $this->vendorPath . '/composer/installed.json')) {
116 116
             $packages = json_decode($this->files->get($path), true);
117 117
         }
118 118
 
119 119
         $ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());
120 120
 
121
-        $this->write(collect($packages['packages'])->mapWithKeys(function ($package) {
121
+        $this->write(collect($packages['packages'])->mapWithKeys(function($package) {
122 122
             return [$this->format($package['name']) => $package['extra']['epesi'] ?? []];
123
-        })->each(function ($configuration) use (&$ignore) {
123
+        })->each(function($configuration) use (&$ignore) {
124 124
             $ignore = array_merge($ignore, $configuration['dont-discover'] ?? []);
125
-        })->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {
125
+        })->reject(function($configuration, $package) use ($ignore, $ignoreAll) {
126 126
             return $ignoreAll || in_array($package, $ignore);
127 127
         })->filter()->all());
128 128
     }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     protected function format($package)
137 137
     {
138
-        return str_replace($this->vendorPath.'/', '', $package);
138
+        return str_replace($this->vendorPath . '/', '', $package);
139 139
     }
140 140
 
141 141
     /**
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 145
      */
146 146
     protected function packagesToIgnore()
147 147
     {
148
-        if (! file_exists($this->basePath.'/composer.json')) {
148
+        if (!file_exists($this->basePath . '/composer.json')) {
149 149
             return [];
150 150
         }
151 151
 
152 152
         return json_decode(file_get_contents(
153
-            $this->basePath.'/composer.json'
153
+            $this->basePath . '/composer.json'
154 154
         ), true)['extra']['epesi']['dont-discover'] ?? [];
155 155
     }
156 156
 
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
      */
164 164
     protected function write(array $manifest)
165 165
     {
166
-        if (! is_writable(dirname($this->manifestPath))) {
167
-            throw new Exception('The '.dirname($this->manifestPath).' directory must be present and writable.');
166
+        if (!is_writable(dirname($this->manifestPath))) {
167
+            throw new Exception('The ' . dirname($this->manifestPath) . ' directory must be present and writable.');
168 168
         }
169 169
 
170 170
         $this->files->put(
171
-            $this->manifestPath, '<?php return '.var_export($manifest, true).';'
171
+            $this->manifestPath, '<?php return ' . var_export($manifest, true) . ';'
172 172
         );
173 173
     }
174 174
 }
Please login to merge, or discard this patch.
src/System/SystemInstallWizard.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		
81 81
 		$form->addControl('language', [\atk4\ui\Form\Control\Dropdown::class, 'values' => $values, 'caption' => __('Select Language'), 'iconLeft' => 'globe'], ['required'=>true])->set($wizard->recall('language', 'en'));
82 82
 		
83
-		$form->onSubmit(function ($form) use ($wizard) {
83
+		$form->onSubmit(function($form) use ($wizard) {
84 84
 			$wizard->memorize('language', $form->model->get('language'));
85 85
 			
86 86
 			App::setLocale($form->model->get('language'));
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		$form->addControl('support', [\atk4\ui\Form\Control\Checkbox::class, 'caption' => __('I will not remove "Support -> About" credit page from the application menu.')], ['required'=>true]);
113 113
 		$form->addControl('store', [\atk4\ui\Form\Control\Checkbox::class, 'caption' => __('I will not remove or rename ":epesi Store" links from the application.', ['epesi' => config('epesi.ui.title')])], ['required'=>true]);
114 114
 		
115
-		$form->onSubmit(function ($form) use ($wizard) {
115
+		$form->onSubmit(function($form) use ($wizard) {
116 116
 			return $wizard->jsNext();
117 117
 		});
118 118
 			
@@ -140,12 +140,12 @@  discard block
 block discarded – undo
140 140
 		$form->addControl('create', [\atk4\ui\Form\Control\Checkbox::class, 'caption' => __('Create New Database')])->on('change', new \atk4\ui\JsExpression('if ($(event.target).is(":checked")) alert([])', [__('WARNING: Make sure you have CREATE access level to do this!')]));
141 141
 
142 142
 		foreach ($wizard->recall('connection', []) as $name => $value) {
143
-			if (! $field = $form->fields[$name]?? null) continue;
143
+			if (!$field = $form->fields[$name] ?? null) continue;
144 144
 			
145 145
 			$field->set($value);
146 146
 		}
147 147
 
148
-		$form->onSubmit(function ($form) use ($wizard) {
148
+		$form->onSubmit(function($form) use ($wizard) {
149 149
 			$connection = $form->model->get();
150 150
 
151 151
 			$wizard->memorize('connection', $connection);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		
194 194
 		$form->model->setMulti($wizard->recall('user', []));
195 195
 		
196
-		$form->validate(function ($form) use ($wizard) {
196
+		$form->validate(function($form) use ($wizard) {
197 197
 			$wizard->memorize('user', $form->model->get());
198 198
 			
199 199
 			return $wizard->jsNext();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,9 @@
 block discarded – undo
140 140
 		$form->addControl('create', [\atk4\ui\Form\Control\Checkbox::class, 'caption' => __('Create New Database')])->on('change', new \atk4\ui\JsExpression('if ($(event.target).is(":checked")) alert([])', [__('WARNING: Make sure you have CREATE access level to do this!')]));
141 141
 
142 142
 		foreach ($wizard->recall('connection', []) as $name => $value) {
143
-			if (! $field = $form->fields[$name]?? null) continue;
143
+			if (! $field = $form->fields[$name]?? null) {
144
+				continue;
145
+			}
144 146
 			
145 147
 			$field->set($value);
146 148
 		}
Please login to merge, or discard this patch.
src/System/User/Access/AccessSettings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	
36 36
 	protected function showEditPermissions()
37 37
 	{
38
-		$permissionsData = Permission::all(['id', 'name'])->map(function($permission){
38
+		$permissionsData = Permission::all(['id', 'name'])->map(function($permission) {
39 39
 			$permission['name'] = trans(ucwords($permission['name']));
40 40
 			
41 41
 			return $permission;
@@ -99,19 +99,19 @@  discard block
 block discarded – undo
99 99
 	
100 100
 	protected function columns()
101 101
 	{
102
-		return $this->columns = $this->columns?: Columns::addTo($this);
102
+		return $this->columns = $this->columns ?: Columns::addTo($this);
103 103
 	}
104 104
 	
105 105
 	protected function permissionId()
106 106
 	{
107
-		return $this->getApp()->stickyGet($this->columns()->name)?: $this->getModuleVariable('permission');
107
+		return $this->getApp()->stickyGet($this->columns()->name) ?: $this->getModuleVariable('permission');
108 108
 	}
109 109
 	
110 110
 	protected function reload($permissionExpression = null)
111 111
 	{
112 112
 		$columns = $this->columns();
113 113
 		
114
-		return $this->reload = $this->reload?: new \atk4\ui\JsReload($columns, [$columns->name => $permissionExpression?: '']);
114
+		return $this->reload = $this->reload ?: new \atk4\ui\JsReload($columns, [$columns->name => $permissionExpression ?: '']);
115 115
 	}
116 116
 	
117 117
 	protected function getModel($array)
Please login to merge, or discard this patch.
src/HomePage/HomePageCore.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@
 block discarded – undo
21 21
 	
22 22
 	public function install()
23 23
 	{
24
-	    Model\HomePage::migrate();
24
+		Model\HomePage::migrate();
25 25
 	    
26 26
 		// setup default home pages
27 27
 		Model\HomePage::create()->import([
28
-	    		[
29
-			    		'path' => 'view/dashboard',
30
-			    		'role' => 'Super Admin'
31
-	    		],
28
+				[
29
+						'path' => 'view/dashboard',
30
+						'role' => 'Super Admin'
31
+				],
32 32
 				[
33 33
 						'path' => 'view/dashboard',
34 34
 						'role' => 'Employee'
Please login to merge, or discard this patch.
src/HomePage/HomePageSettings.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 		$grid = $this->add([
25 25
 				Crud::class,
26
-		          'menu' => ActionBar::instance(),
26
+				  'menu' => ActionBar::instance(),
27 27
 // 		        'model' => HomePage::create(),
28 28
 				'displayFields' => ['path', 'role'],
29 29
 				'editFields' => ['path', 'role'],
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 
51 51
 // 		$plugin->extendList('path');
52 52
 
53
-		$grid->addDragHandler()->onReorder(function ($order) {
53
+		$grid->addDragHandler()->onReorder(function($order) {
54 54
 			foreach (Model\HomePage::create() as $homepage) {
55 55
 				$homepage->save(['priority' => array_search($homepage['id'], $order)]);
56 56
 			}
Please login to merge, or discard this patch.
src/HomePage/Model/HomePage.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 class HomePage extends Model
13 13
 {
14
-    use HasEpesiConnection;
14
+	use HasEpesiConnection;
15 15
     
16 16
 	public $table = 'home_pages';
17 17
 	
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		parent::init();
32 32
 
33 33
 		$this->addFields([
34
-		        'path' => [
34
+				'path' => [
35 35
 						'caption' => __('Page'),
36 36
 						'values' => self::list(),
37 37
 						'ui' => [
@@ -41,23 +41,23 @@  discard block
 block discarded – undo
41 41
 								'filter' => true
42 42
 						],
43 43
 				],
44
-		        'role' => [
44
+				'role' => [
45 45
 						'caption' => __('Role'), 
46 46
 						'values' => Role::get()->pluck('name', 'name')->all(), 
47 47
 						'ui' => [
48 48
 								'filter' => true
49 49
 						]
50 50
 				],
51
-		        'date' => [
51
+				'date' => [
52 52
 						'type' => 'date', 
53 53
 						'caption' => __('Date'),
54
-		                'never_persist' => true,
54
+						'never_persist' => true,
55 55
 						'ui' => [
56 56
 								'filter' => true
57 57
 						]
58 58
 				],
59 59
 				'priority' => [
60
-				        'default' => 0
60
+						'default' => 0
61 61
 				],
62 62
 		]);
63 63
 		
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		$this->setOrder('priority');
66 66
 
67 67
 		$this->onHook(\atk4\data\Model::HOOK_BEFORE_INSERT, function($model, & $data) {
68
-			$data['priority'] = $data['priority']?: $this->action('fx', ['max', 'priority'])->getOne() + 1;
68
+			$data['priority'] = $data['priority'] ?: $this->action('fx', ['max', 'priority'])->getOne() + 1;
69 69
 		});
70 70
 	}
71 71
 	
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	{
79 79
 		static $cache;
80 80
 		
81
-		if (! isset($cache)) {
81
+		if (!isset($cache)) {
82 82
 			$cache = [];
83 83
 			foreach (HomePageJoint::collect() as $joint) {
84 84
 				$cache[$joint->link()] = $joint->caption();
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public static function ofUser()
97 97
 	{
98
-		if (! $user = Auth::user()) return;
98
+		if (!$user = Auth::user()) return;
99 99
 		
100 100
 		return self::create()->addCondition('role', $user->roles()->pluck('name')->toArray())->loadAny();
101 101
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,9 @@
 block discarded – undo
94 94
 	 */
95 95
 	public static function ofUser()
96 96
 	{
97
-		if (! $user = Auth::user()) return;
97
+		if (! $user = Auth::user()) {
98
+			return;
99
+		}
98 100
 		
99 101
 		return self::create()->addCondition('role', $user->roles()->pluck('name')->toArray())->loadAny();
100 102
 	}
Please login to merge, or discard this patch.