Passed
Push — master ( 7c65be...4954b5 )
by Georgi
04:05
created
src/System/User/Access/AccessCore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 	public static function boot()
51 51
 	{
52 52
 		// allow Super Admin full access
53
-		Gate::after(function ($user, $ability) {
53
+		Gate::after(function($user, $ability) {
54 54
 			return $user->hasRole('Super Admin');
55 55
 		});
56 56
 	}
Please login to merge, or discard this patch.
src/System/User/Access/AccessView.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?: $this->add('Columns');
102
+		return $this->columns = $this->columns ?: $this->add('Columns');
103 103
 	}
104 104
 	
105 105
 	protected function permissionId()
106 106
 	{
107
-		return $this->app->stickyGet($this->columns()->name)?: $this->getModuleVariable('permission');
107
+		return $this->app->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 jsReload($columns, [$columns->name => $permissionExpression?: '']);
114
+		return $this->reload = $this->reload ?: new jsReload($columns, [$columns->name => $permissionExpression ?: '']);
115 115
 	}
116 116
 	
117 117
 	protected function getModel($array)
Please login to merge, or discard this patch.
src/System/User/Settings/Database/Models/UserSetting.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	}
24 24
 	
25 25
 	private static function cacheUserVariables() {
26
-		if(isset(self::$userVariables)) return;
26
+		if (isset(self::$userVariables)) return;
27 27
 
28 28
 		$userId = Auth::id();
29 29
 		
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 	
35 35
 	private static function cacheAdminVariables() {
36
-		if(isset(self::$adminVariables)) return;
36
+		if (isset(self::$adminVariables)) return;
37 37
 
38 38
 		foreach (self::where('user_id', 0) as $row) {
39 39
 			self::$adminVariables[$row['group']][$row['name']] = $row['value'];
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	}
42 42
 	
43 43
 	public static function get($group, $name, $user = null) {
44
-		$user = $user?: Auth::id();
44
+		$user = $user ?: Auth::id();
45 45
 		
46 46
 		if (!$user || !is_numeric($user)) return;
47 47
 		
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	}
52 52
 	
53 53
 	public static function getGroup($group, $user = null) {
54
-		$user = $user?: Auth::id();
54
+		$user = $user ?: Auth::id();
55 55
 		
56 56
 		if (!$user || !is_numeric($user)) return;
57 57
 		
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	}
74 74
 	
75 75
 	public static function put($group, $name, $value, $user = null) {
76
-		$user_id = $user?: Auth::id();
76
+		$user_id = $user ?: Auth::id();
77 77
 		
78 78
 		if (!$user_id || !is_numeric($user_id)) return;
79 79
 		
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	}
102 102
 	
103 103
 	public static function forget($group, $name, $user = null) {
104
-		$user_id = $user?: Auth::id();
104
+		$user_id = $user ?: Auth::id();
105 105
 		
106 106
 		if (!$user_id || !is_numeric($user_id)) return;
107 107
 		
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@  discard block
 block discarded – undo
23 23
 	}
24 24
 	
25 25
 	private static function cacheUserVariables() {
26
-		if(isset(self::$userVariables)) return;
26
+		if(isset(self::$userVariables)) {
27
+			return;
28
+		}
27 29
 
28 30
 		$userId = Auth::id();
29 31
 		
@@ -33,7 +35,9 @@  discard block
 block discarded – undo
33 35
 	}
34 36
 	
35 37
 	private static function cacheAdminVariables() {
36
-		if(isset(self::$adminVariables)) return;
38
+		if(isset(self::$adminVariables)) {
39
+			return;
40
+		}
37 41
 
38 42
 		foreach (self::where('user_id', 0) as $row) {
39 43
 			self::$adminVariables[$row['group']][$row['name']] = $row['value'];
@@ -43,7 +47,9 @@  discard block
 block discarded – undo
43 47
 	public static function get($group, $name, $user = null) {
44 48
 		$user = $user?: Auth::id();
45 49
 		
46
-		if (!$user || !is_numeric($user)) return;
50
+		if (!$user || !is_numeric($user)) {
51
+			return;
52
+		}
47 53
 		
48 54
 		self::cache();
49 55
 		
@@ -53,7 +59,9 @@  discard block
 block discarded – undo
53 59
 	public static function getGroup($group, $user = null) {
54 60
 		$user = $user?: Auth::id();
55 61
 		
56
-		if (!$user || !is_numeric($user)) return;
62
+		if (!$user || !is_numeric($user)) {
63
+			return;
64
+		}
57 65
 		
58 66
 		self::cache();
59 67
 
@@ -75,7 +83,9 @@  discard block
 block discarded – undo
75 83
 	public static function put($group, $name, $value, $user = null) {
76 84
 		$user_id = $user?: Auth::id();
77 85
 		
78
-		if (!$user_id || !is_numeric($user_id)) return;
86
+		if (!$user_id || !is_numeric($user_id)) {
87
+			return;
88
+		}
79 89
 		
80 90
 		self::cache();
81 91
 
@@ -103,7 +113,9 @@  discard block
 block discarded – undo
103 113
 	public static function forget($group, $name, $user = null) {
104 114
 		$user_id = $user?: Auth::id();
105 115
 		
106
-		if (!$user_id || !is_numeric($user_id)) return;
116
+		if (!$user_id || !is_numeric($user_id)) {
117
+			return;
118
+		}
107 119
 		
108 120
 		self::cache();
109 121
 		
Please login to merge, or discard this patch.
Database/Migrations/2019_09_18_173148_create_user_settings_table.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -6,31 +6,31 @@
 block discarded – undo
6 6
 
7 7
 class CreateUserSettingsTable extends Migration
8 8
 {
9
-    /**
10
-     * Run the migrations.
11
-     *
12
-     * @return void
13
-     */
14
-    public function up()
15
-    {
16
-    	$this->down();
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		$this->down();
17 17
     	
18
-    	Schema::create('user_settings', function (Blueprint $table) {
19
-    		$table->increments('id');
20
-    		$table->unsignedInteger('user_id');
21
-            $table->string('group', 512);
22
-            $table->string('name', 128);
23
-            $table->text('value');
24
-        });
25
-    }
18
+		Schema::create('user_settings', function (Blueprint $table) {
19
+			$table->increments('id');
20
+			$table->unsignedInteger('user_id');
21
+			$table->string('group', 512);
22
+			$table->string('name', 128);
23
+			$table->text('value');
24
+		});
25
+	}
26 26
 
27
-    /**
28
-     * Reverse the migrations.
29
-     *
30
-     * @return void
31
-     */
32
-    public function down()
33
-    {
34
-    	Schema::dropIfExists('user_settings');
35
-    }
27
+	/**
28
+	 * Reverse the migrations.
29
+	 *
30
+	 * @return void
31
+	 */
32
+	public function down()
33
+	{
34
+		Schema::dropIfExists('user_settings');
35
+	}
36 36
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     {
16 16
     	$this->down();
17 17
     	
18
-    	Schema::create('user_settings', function (Blueprint $table) {
18
+    	Schema::create('user_settings', function(Blueprint $table) {
19 19
     		$table->increments('id');
20 20
     		$table->unsignedInteger('user_id');
21 21
             $table->string('group', 512);
Please login to merge, or discard this patch.
src/System/User/Settings/Integration/Joints/UserSettingsJoint.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	 */
26 26
 	public function group()
27 27
 	{
28
-		return $this->group?: static::class;
28
+		return $this->group ?: static::class;
29 29
 	}
30 30
 	
31 31
 	/**
Please login to merge, or discard this patch.
src/Controllers/SystemController.php 3 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -12,41 +12,41 @@
 block discarded – undo
12 12
 
13 13
 class SystemController extends Controller
14 14
 {
15
-    public function index()
16
-    {
17
-    	return SystemCore::isInstalled()? redirect('home'): redirect('install');
18
-    }
15
+	public function index()
16
+	{
17
+		return SystemCore::isInstalled()? redirect('home'): redirect('install');
18
+	}
19 19
     
20
-    public function install(Epesi $epesi)
21
-    {
22
-    	// make sure the installation information is fresh
23
-    	ModuleManager::clearCache();
20
+	public function install(Epesi $epesi)
21
+	{
22
+		// make sure the installation information is fresh
23
+		ModuleManager::clearCache();
24 24
     	
25
-    	if (SystemCore::isInstalled()) return redirect('home');
25
+		if (SystemCore::isInstalled()) return redirect('home');
26 26
     	
27
-    	$epesi->title = config('epesi.app.title') . ' > ' . __('Installation');
27
+		$epesi->title = config('epesi.app.title') . ' > ' . __('Installation');
28 28
     	
29
-    	$epesi->initLayout('Centered');
29
+		$epesi->initLayout('Centered');
30 30
     	
31
-    	$epesi->layout->set('logo', url('logo'));
32
-    	$epesi->layout->template->setHTML('copyright', config('epesi.app.copyright'));
31
+		$epesi->layout->set('logo', url('logo'));
32
+		$epesi->layout->template->setHTML('copyright', config('epesi.app.copyright'));
33 33
     	
34
-    	$epesi->add(new SystemInstallWizard());
34
+		$epesi->add(new SystemInstallWizard());
35 35
     	
36
-    	return $epesi->response();
37
-    }
36
+		return $epesi->response();
37
+	}
38 38
     
39
-    public function home()
40
-    {
41
-    	return redirect(SystemCore::isInstalled()? HomePageCommon::getUserHomePagePath(): 'install');
42
-    }
39
+	public function home()
40
+	{
41
+		return redirect(SystemCore::isInstalled()? HomePageCommon::getUserHomePagePath(): 'install');
42
+	}
43 43
     
44
-    public function logo()
45
-    {
46
-    	$path = storage_path(implode(DIRECTORY_SEPARATOR, ['app', 'public', 'system', 'logo.png']));
44
+	public function logo()
45
+	{
46
+		$path = storage_path(implode(DIRECTORY_SEPARATOR, ['app', 'public', 'system', 'logo.png']));
47 47
 
48
-    	$file = new \Symfony\Component\HttpFoundation\File\File($path);
48
+		$file = new \Symfony\Component\HttpFoundation\File\File($path);
49 49
     	
50
-    	return response(File::get($path), 200, ['Content-type' => $file->getMimeType()])->setMaxAge(604800)->setPublic();
51
-    }
50
+		return response(File::get($path), 200, ['Content-type' => $file->getMimeType()])->setMaxAge(604800)->setPublic();
51
+	}
52 52
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 {
15 15
     public function index()
16 16
     {
17
-    	return SystemCore::isInstalled()? redirect('home'): redirect('install');
17
+    	return SystemCore::isInstalled() ? redirect('home') : redirect('install');
18 18
     }
19 19
     
20 20
     public function install(Epesi $epesi)
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     
39 39
     public function home()
40 40
     {
41
-    	return redirect(SystemCore::isInstalled()? HomePageCommon::getUserHomePagePath(): 'install');
41
+    	return redirect(SystemCore::isInstalled() ? HomePageCommon::getUserHomePagePath() : 'install');
42 42
     }
43 43
     
44 44
     public function logo()
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@
 block discarded – undo
22 22
     	// make sure the installation information is fresh
23 23
     	ModuleManager::clearCache();
24 24
     	
25
-    	if (SystemCore::isInstalled()) return redirect('home');
25
+    	if (SystemCore::isInstalled()) {
26
+    		return redirect('home');
27
+    	}
26 28
     	
27 29
     	$epesi->title = config('epesi.app.title') . ' > ' . __('Installation');
28 30
     	
Please login to merge, or discard this patch.
src/System/Integration/Modules/ModuleManager.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 	public static function isInstalled($classOrAlias)
21 21
 	{
22
-		return self::getClass($classOrAlias, true)? 1: 0;
22
+		return self::getClass($classOrAlias, true) ? 1 : 0;
23 23
 	}
24 24
 	
25 25
 	public static function isAvailable($classOrAlias)
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @return string;
35 35
 	 */
36 36
 	public static function getClass($classOrAlias, $installedOnly = false) {
37
-		$modules = $installedOnly? self::getInstalled(): self::getAll();
37
+		$modules = $installedOnly ? self::getInstalled() : self::getAll();
38 38
 		
39 39
 		if (collect($modules)->contains($classOrAlias)) return $classOrAlias;
40 40
 		
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public static function getAll()
68 68
 	{
69
-		return self::getCached('epesi-modules-available', function () {
69
+		return self::getCached('epesi-modules-available', function() {
70 70
 			$modules = collect();
71
-			foreach (array_merge(config('epesi.modules', []), self::packageManifest()->modules()?: []) as $namespace => $path) {
71
+			foreach (array_merge(config('epesi.modules', []), self::packageManifest()->modules() ?: []) as $namespace => $path) {
72 72
 				foreach (self::discoverModuleClasses($namespace, $path) as $moduleClass) {
73 73
 					$modules->add(['alias' => $moduleClass::alias(), 'class' => $moduleClass]);
74 74
 				}
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
 	protected static function discoverModuleClasses($namespace, $basePath)
82 82
 	{
83 83
 		$ret = collect();
84
-		foreach (glob($basePath . '/*', GLOB_ONLYDIR|GLOB_NOSORT) as $path) {
84
+		foreach (glob($basePath . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $path) {
85 85
 			$moduleNamespace = trim($namespace, '\\') . '\\' . basename($path);
86 86
 			
87 87
 			$ret = $ret->merge(self::discoverModuleClasses($moduleNamespace, $path));
88 88
 			
89 89
 			$moduleClass = $moduleNamespace . '\\' . basename($path) . 'Core';
90 90
 			
91
-			if (! is_a($moduleClass, ModuleCore::class, true)) continue;
91
+			if (!is_a($moduleClass, ModuleCore::class, true)) continue;
92 92
 			
93 93
 			$ret->add($moduleClass);
94 94
 		}
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	protected static function getCached($key, \Closure $default)
107 107
 	{
108
-		if (! Cache::has($key)) {
108
+		if (!Cache::has($key)) {
109 109
 			Cache::forever($key, $default());
110 110
 		}
111 111
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	public static function collect($method, $args = [])
143 143
 	{
144
-		$args = is_array($args)? $args: [$args];
144
+		$args = is_array($args) ? $args : [$args];
145 145
 		
146 146
 		$installedModules = self::getInstalled();
147 147
 		
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 		
155 155
 		$ret = [];
156 156
 		foreach ($installedModules as $module) {
157
-			if (! $list = $module::$method(...$args)) continue;
157
+			if (!$list = $module::$method(...$args)) continue;
158 158
 			
159
-			$ret = array_merge($ret, is_array($list)? $list: [$list]);
159
+			$ret = array_merge($ret, is_array($list) ? $list : [$list]);
160 160
 		}
161 161
 		
162 162
 		return $ret;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 			return true;
176 176
 		}
177 177
 		
178
-		if (! $moduleClass = self::getClass($classOrAlias)) {			
178
+		if (!$moduleClass = self::getClass($classOrAlias)) {			
179 179
 			throw new \Exception('Module "' . $classOrAlias . '" could not be identified');
180 180
 		}
181 181
 		
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
 			$parentModule = array_shift($unsatisfiedDependencies);
235 235
 				
236 236
 			if (self::$processing[$parentModule]?? false) {
237
-				throw new Exception('Cross dependency: '. $parentModule);
237
+				throw new Exception('Cross dependency: ' . $parentModule);
238 238
 			}
239 239
 				
240
-			if (! self::isAvailable($parentModule)) {
240
+			if (!self::isAvailable($parentModule)) {
241 241
 				throw new Exception('Module not found: "' . $parentModule . '"');
242 242
 			}
243 243
 	
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
 	
259 259
 	public static function uninstall($classOrAlias)
260 260
 	{
261
-		if (! self::isInstalled($classOrAlias)) {
261
+		if (!self::isInstalled($classOrAlias)) {
262 262
 			print ('Module "' . $classOrAlias . '" is not installed!');
263 263
 			
264 264
 			return true;
265 265
 		}
266 266
 		
267
-		if (! $moduleClass = self::getClass($classOrAlias)) {
267
+		if (!$moduleClass = self::getClass($classOrAlias)) {
268 268
 			throw new \Exception('Module "' . $classOrAlias . '" could not be identified');
269 269
 		}
270 270
 		
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,9 @@  discard block
 block discarded – undo
36 36
 	public static function getClass($classOrAlias, $installedOnly = false) {
37 37
 		$modules = $installedOnly? self::getInstalled(): self::getAll();
38 38
 		
39
-		if (collect($modules)->contains($classOrAlias)) return $classOrAlias;
39
+		if (collect($modules)->contains($classOrAlias)) {
40
+			return $classOrAlias;
41
+		}
40 42
 		
41 43
 		return $modules[$classOrAlias]?? null;
42 44
 	}
@@ -88,7 +90,9 @@  discard block
 block discarded – undo
88 90
 			
89 91
 			$moduleClass = $moduleNamespace . '\\' . basename($path) . 'Core';
90 92
 			
91
-			if (! is_a($moduleClass, ModuleCore::class, true)) continue;
93
+			if (! is_a($moduleClass, ModuleCore::class, true)) {
94
+				continue;
95
+			}
92 96
 			
93 97
 			$ret->add($moduleClass);
94 98
 		}
@@ -154,7 +158,9 @@  discard block
 block discarded – undo
154 158
 		
155 159
 		$ret = [];
156 160
 		foreach ($installedModules as $module) {
157
-			if (! $list = $module::$method(...$args)) continue;
161
+			if (! $list = $module::$method(...$args)) {
162
+				continue;
163
+			}
158 164
 			
159 165
 			$ret = array_merge($ret, is_array($list)? $list: [$list]);
160 166
 		}
Please login to merge, or discard this patch.
src/System/Integration/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)->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)->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)->mapWithKeys(function ($package) {
121
+        $this->write(collect($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/HomePage/HomePageSettings.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 			return [['Template', $availablePages[$row[$column]]?? '[' . __('missing: :path', ['path' => $row[$column]]) . ']']];
48 48
 		}]);
49 49
 		
50
-		$this->grid->addDragHandler()->onReorder(function ($order) {
50
+		$this->grid->addDragHandler()->onReorder(function($order) {
51 51
 			$result = true;
52 52
 			foreach ($this->getHomepages() as $homepage) {
53 53
 				$homepage->priority = array_search($homepage->id, $order);
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 				$result &= $homepage->save();
56 56
 			}
57 57
 			
58
-			return $result? $this->notify(__('Homepages reordered!')): $this->notifyError(__('Error saving order!'));
58
+			return $result ? $this->notify(__('Homepages reordered!')) : $this->notifyError(__('Error saving order!'));
59 59
 		});
60 60
 		
61
-		$this->grid->addAction(['icon' => 'red trash'], function ($jschain, $id) {
61
+		$this->grid->addAction(['icon' => 'red trash'], function($jschain, $id) {
62 62
 			HomePage::find($id)->delete();
63 63
 				
64 64
 			return $jschain->closest('tr')->transition('fade left');
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
 		
82 82
 		$rowsEmpty = [];
83 83
 		
84
-		$model = new \atk4\data\Model($rows? new \atk4\data\Persistence_Static($rows): new \atk4\data\Persistence_Array($rowsEmpty));
84
+		$model = new \atk4\data\Model($rows ? new \atk4\data\Persistence_Static($rows) : new \atk4\data\Persistence_Array($rowsEmpty));
85 85
 	
86
-		$pathField = $rows? $model->hasField('path'): $model->addField('path');
86
+		$pathField = $rows ? $model->hasField('path') : $model->addField('path');
87 87
 			
88
-		$roleField = $rows? $model->hasField('role'): $model->addField('role');
88
+		$roleField = $rows ? $model->hasField('role') : $model->addField('role');
89 89
 		
90 90
 		$pathField->setDefaults(['caption' => __('Page'), 'values' => $availablePages]);
91 91
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	
102 102
 	public function getHomepageForm()
103 103
 	{
104
-		if (! $this->form) {		
104
+		if (!$this->form) {		
105 105
 			$this->form = new Form(['buttonSave' => ['Button', __('Save'), 'primary']]);
106 106
 	
107 107
 			$this->form->addHook('submit', function($form) {
Please login to merge, or discard this patch.