Passed
Push — master ( feb473...abec42 )
by Georgi
02:54
created
src/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/User/Settings/Database/Models/UserSetting.php 1 patch
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::user()->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::user()->id;
44
+		$user = $user ?: Auth::user()->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::user()->id;
54
+		$user = $user ?: Auth::user()->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::user()->id;
76
+		$user_id = $user ?: Auth::user()->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::user()->id;
104
+		$user_id = $user ?: Auth::user()->id;
105 105
 		
106 106
 		if (!$user_id || !is_numeric($user_id)) return;
107 107
 		
Please login to merge, or discard this patch.
Database/Migrations/2019_09_18_173148_create_user_settings_table.php 1 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/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.
Dashboard/Database/Migrations/2019_09_18_173148_create_dashboard_tables.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@
 block discarded – undo
15 15
     {
16 16
     	$this->down();
17 17
     	
18
-    	Schema::create('dashboards', function (Blueprint $table) {
18
+    	Schema::create('dashboards', function(Blueprint $table) {
19 19
     		$table->increments('id');
20 20
     		$table->unsignedInteger('user_id');
21 21
             $table->string('name', 64);
22 22
             $table->smallInteger('position');
23 23
         });
24 24
 
25
-    	Schema::create('dashboard_applets', function (Blueprint $table) {
25
+    	Schema::create('dashboard_applets', function(Blueprint $table) {
26 26
     		$table->increments('id');
27 27
     		$table->unsignedInteger('dashboard_id');
28 28
             $table->string('class', 512);            
Please login to merge, or discard this patch.
src/Dashboard/DashboardView.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	
25 25
 	public function body()
26 26
 	{
27
-		if (! $this->isSingleDashboard()) {
27
+		if (!$this->isSingleDashboard()) {
28 28
 			$this->location($this->dashboard()->name);
29 29
 		}
30 30
 		
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		
43 43
 		$applets = $dashboard->applets()->orderBy('column')->orderBy('row')->get();
44 44
 
45
-		$columns = $this->add(['Columns', 'id' => 'dashboard', 'ui' => 'three stackable grid'  . ($this->isLocked()? ' locked': '')]);
45
+		$columns = $this->add(['Columns', 'id' => 'dashboard', 'ui' => 'three stackable grid' . ($this->isLocked() ? ' locked' : '')]);
46 46
 		
47 47
 		foreach ([1, 2, 3] as $columnId) {
48 48
 			/** @scrutinizer ignore-call */
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 					]
56 56
 			]);
57 57
 			
58
-			foreach ($applets->where('column', $columnId) as $applet ) {
58
+			foreach ($applets->where('column', $columnId) as $applet) {
59 59
 				$col->add([
60 60
 						new Applet(),
61 61
 						'appletId' => $applet->id,
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 			}
67 67
 		}
68 68
 		
69
-		if (! $this->isLocked()) {
69
+		if (!$this->isLocked()) {
70 70
 			$columns->js(true)->find('.sortable')->sortable([
71 71
 					'cursor' => 'move',
72 72
 					'handle' => '.panel-sortable-handle',
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 					])
85 85
 			]));
86 86
 			
87
-			$columns->js(true)->find('.applet-close')->click(new jsFunction(['e'], [new jsExpression('if (confirm("' .  __('Delete this applet?') . '")) {$(e.target).closest(".applet").fadeOut(400, function(){var col = $(this).closest(".column.sortable");this.remove();col.trigger("sortupdate");})}')]));
87
+			$columns->js(true)->find('.applet-close')->click(new jsFunction(['e'], [new jsExpression('if (confirm("' . __('Delete this applet?') . '")) {$(e.target).closest(".applet").fadeOut(400, function(){var col = $(this).closest(".column.sortable");this.remove();col.trigger("sortupdate");})}')]));
88 88
 		}
89 89
 		
90 90
 		$this->columns = $columns;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 				]
132 132
 		]);
133 133
 		
134
-		foreach ( AppletJoint::collect() as $applet ) {
134
+		foreach (AppletJoint::collect() as $applet) {
135 135
 			$col->add([
136 136
 					new Applet(),
137 137
 					'appletId' => 'new_' . str_ireplace('\\', '-', get_class($applet)),
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 	{
261 261
 		$dashboard = Dashboard::find($dashboardId);
262 262
 
263
-		return $dashboard->delete()? [
263
+		return $dashboard->delete() ? [
264 264
 				$this->notify(__('Dashboard ":name" deleted, redirecting ...', ['name' => $dashboard->name])),
265 265
 				new jsExpression('window.setTimeout(function() {window.location.replace([])}, 1200)', [self::selfLink()])
266
-		]: $this->notifyError(__('Error deleting dashboard'));
266
+		] : $this->notifyError(__('Error deleting dashboard'));
267 267
 	}
268 268
 	
269 269
 	public function reorderDashboards($view)
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 		$grid = $view->add(['Grid', 'paginator' => false, 'menu' => false]);
283 283
 		$grid->setModel(new \atk4\data\Model(new \atk4\data\Persistence_Static($rows)));
284 284
 		
285
-		$grid->addDragHandler()->onReorder(function ($order) use ($dashboards) {
285
+		$grid->addDragHandler()->onReorder(function($order) use ($dashboards) {
286 286
 			$result = true;
287 287
 			foreach ($dashboards as $dashboard) {
288 288
 				$dashboard->position = array_search($dashboard->id, $order);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 				$result &= $dashboard->save();
291 291
 			}
292 292
 			
293
-			return $result? $this->notify(__('Dashboards reordered!')): $this->notifyError(__('Error saving order!'));
293
+			return $result ? $this->notify(__('Dashboards reordered!')) : $this->notifyError(__('Error saving order!'));
294 294
 		});
295 295
 			
296 296
 		$view->add(['View', 'ui' => 'buttons'])->add(['Button', __('Done'), 'primary'])->on('click', new jsExpression('location.reload()'));
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 	
368 368
 	public function isLocked()
369 369
 	{
370
-		return $this->locked || ! Auth::user()->can('edit dashboard');
370
+		return $this->locked || !Auth::user()->can('edit dashboard');
371 371
 	}
372 372
 	
373 373
 	protected function isSingleDashboard()
@@ -383,18 +383,18 @@  discard block
 block discarded – undo
383 383
 	 */
384 384
 	protected function dashboard()
385 385
 	{
386
-		if (! is_object($this->dashboard)) {
387
-			$this->dashboard = $this->dashboard? Dashboard::find($this->dashboard): $this->defaultUserDashboard();
386
+		if (!is_object($this->dashboard)) {
387
+			$this->dashboard = $this->dashboard ? Dashboard::find($this->dashboard) : $this->defaultUserDashboard();
388 388
 		}
389 389
 
390
-		return $this->dashboard?: abort(404);
390
+		return $this->dashboard ?: abort(404);
391 391
 	}
392 392
 	
393 393
 	protected function defaultUserDashboard()
394 394
 	{
395 395
 		$userDashboard = $this->userDashboards()->orderBy('position')->first();
396 396
 		
397
-		if (! $userDashboard) {
397
+		if (!$userDashboard) {
398 398
 			$this->lock();
399 399
 			
400 400
 			$userDashboard = $this->defaultSystemDashboard();
@@ -418,6 +418,6 @@  discard block
 block discarded – undo
418 418
 	 */
419 419
 	protected function userId()
420 420
 	{
421
-		return $this->admin? 0: Auth::user()->id;
421
+		return $this->admin ? 0 : Auth::user()->id;
422 422
 	}
423 423
 }
Please login to merge, or discard this patch.
src/Dashboard/Seeds/Applet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 			$this->set($joint->info())->setAttr('searchkey', strtolower($joint->caption() . ';' . $joint->info()));
29 29
 		}
30 30
 		else {
31
-			if (! $this->locked) {
31
+			if (!$this->locked) {
32 32
 				$this->addControl('close', 'applet-close')->setAttr('title', __('Close applet'));
33 33
 			}
34 34
 			
Please login to merge, or discard this patch.
Access/Database/Migrations/2019_10_24_195050_create_permission_tables.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,21 +16,21 @@  discard block
 block discarded – undo
16 16
         $tableNames = config('permission.table_names');
17 17
         $columnNames = config('permission.column_names');
18 18
 
19
-        Schema::create($tableNames['permissions'], function (Blueprint $table) {
19
+        Schema::create($tableNames['permissions'], function(Blueprint $table) {
20 20
             $table->bigIncrements('id');
21 21
             $table->string('name');
22 22
             $table->string('guard_name');
23 23
             $table->timestamps();
24 24
         });
25 25
 
26
-        Schema::create($tableNames['roles'], function (Blueprint $table) {
26
+        Schema::create($tableNames['roles'], function(Blueprint $table) {
27 27
             $table->bigIncrements('id');
28 28
             $table->string('name');
29 29
             $table->string('guard_name');
30 30
             $table->timestamps();
31 31
         });
32 32
 
33
-        Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) {
33
+        Schema::create($tableNames['model_has_permissions'], function(Blueprint $table) use ($tableNames, $columnNames) {
34 34
             $table->unsignedBigInteger('permission_id');
35 35
 
36 36
             $table->string('model_type');
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                     'model_has_permissions_permission_model_type_primary');
47 47
         });
48 48
 
49
-        Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) {
49
+        Schema::create($tableNames['model_has_roles'], function(Blueprint $table) use ($tableNames, $columnNames) {
50 50
             $table->unsignedBigInteger('role_id');
51 51
 
52 52
             $table->string('model_type');
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                     'model_has_roles_role_model_type_primary');
63 63
         });
64 64
 
65
-        Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
65
+        Schema::create($tableNames['role_has_permissions'], function(Blueprint $table) use ($tableNames) {
66 66
             $table->unsignedBigInteger('permission_id');
67 67
             $table->unsignedBigInteger('role_id');
68 68
 
Please login to merge, or discard this patch.
User/Database/Migrations/2014_10_12_100000_create_password_resets_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('password_resets', function (Blueprint $table) {
16
+        Schema::create('password_resets', function(Blueprint $table) {
17 17
             $table->string('email')->index();
18 18
             $table->string('token');
19 19
             $table->timestamp('created_at')->nullable();
Please login to merge, or discard this patch.