Passed
Push — master ( 9b6cf0...d3c4d5 )
by Georgi
05:20
created
src/HomePage/Database/Models/HomePage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 		$this->setOrder('priority');
27 27
 
28 28
 		$this->addHook('beforeInsert', function($model, & $data) {
29
-			$data['priority'] = $data['priority']?: $this->action('fx', ['max', 'priority'])->getOne() + 1;
29
+			$data['priority'] = $data['priority'] ?: $this->action('fx', ['max', 'priority'])->getOne() + 1;
30 30
 		});
31 31
 		
32 32
 		$this->getAction('edit')->enabled = function($model) {
Please login to merge, or discard this patch.
src/HomePage/HomePageCore.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
23 23
 	{
24 24
 		// setup default home pages
25 25
 		Database\Models\HomePage::create()->import([
26
-	    		[
27
-			    		'path' => 'view/dashboard',
28
-			    		'role' => 'Super Admin'
29
-	    		],
26
+				[
27
+						'path' => 'view/dashboard',
28
+						'role' => 'Super Admin'
29
+				],
30 30
 				[
31 31
 						'path' => 'view/dashboard',
32 32
 						'role' => 'Employee'
Please login to merge, or discard this patch.
src/HomePage/HomePageSettings.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 			return [['Template', $availablePages[$row[$column]]?? '[' . __('missing: :path', ['path' => $row[$column]]) . ']']];
49 49
 		}]);
50 50
 		
51
-		$this->grid->addDragHandler()->onReorder(function ($order) {
51
+		$this->grid->addDragHandler()->onReorder(function($order) {
52 52
 			$result = true;
53 53
 			foreach (HomePage::create() as $homepage) {
54 54
 				$homepage['priority'] = array_search($homepage['id'], $order);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 				$result &= $homepage->save();
57 57
 			}
58 58
 			
59
-			return $result? $this->notify(__('Homepages reordered!')): $this->notifyError(__('Error saving order!'));
59
+			return $result ? $this->notify(__('Homepages reordered!')) : $this->notifyError(__('Error saving order!'));
60 60
 		});
61 61
 	}
62 62
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	{
70 70
 		static $cache;
71 71
 		
72
-		if (! isset($cache)) {
72
+		if (!isset($cache)) {
73 73
 			$cache = [];
74 74
 			foreach (HomePageJoint::collect() as $joint) {
75 75
 				$cache[$joint->link()] = $joint->caption();
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public static function getUserHomePage()
88 88
 	{
89
-		if (! $user = Auth::user()) return;
89
+		if (!$user = Auth::user()) return;
90 90
 
91 91
 		return HomePage::create()->addCondition('role', $user->roles()->pluck('name')->toArray())->loadAny();
92 92
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,9 @@
 block discarded – undo
86 86
 	 */
87 87
 	public static function getUserHomePage()
88 88
 	{
89
-		if (! $user = Auth::user()) return;
89
+		if (! $user = Auth::user()) {
90
+			return;
91
+		}
90 92
 
91 93
 		return HomePage::create()->addCondition('role', $user->roles()->pluck('name')->toArray())->loadAny();
92 94
 	}
Please login to merge, or discard this patch.