Passed
Push — master ( 1601bb...5d0926 )
by Georgi
03:38
created
src/HomePage/Database/Models/HomePage.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$this->setOrder('priority');
44 44
 
45 45
 		$this->addHook('beforeInsert', function($model, & $data) {
46
-			$data['priority'] = $data['priority']?: $this->action('fx', ['max', 'priority'])->getOne() + 1;
46
+			$data['priority'] = $data['priority'] ?: $this->action('fx', ['max', 'priority'])->getOne() + 1;
47 47
 		});
48 48
 	}
49 49
 	
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	{
57 57
 		static $cache;
58 58
 		
59
-		if (! isset($cache)) {
59
+		if (!isset($cache)) {
60 60
 			$cache = [];
61 61
 			foreach (HomePageJoint::collect() as $joint) {
62 62
 				$cache[$joint->link()] = $joint->caption();
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public static function ofUser()
75 75
 	{
76
-		if (! $user = Auth::user()) return;
76
+		if (!$user = Auth::user()) return;
77 77
 		
78 78
 		return self::addCondition('role', $user->roles()->pluck('name')->toArray())->loadAny();
79 79
 	}
@@ -85,6 +85,6 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	public static function pathOfUser()
87 87
 	{
88
-		return HomePage::ofUser()['path']?: self::$defaultPath;
88
+		return HomePage::ofUser()['path'] ?: self::$defaultPath;
89 89
 	}
90 90
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,9 @@
 block discarded – undo
73 73
 	 */
74 74
 	public static function ofUser()
75 75
 	{
76
-		if (! $user = Auth::user()) return;
76
+		if (! $user = Auth::user()) {
77
+			return;
78
+		}
77 79
 		
78 80
 		return self::addCondition('role', $user->roles()->pluck('name')->toArray())->loadAny();
79 81
 	}
Please login to merge, or discard this patch.
src/HomePage/HomePageSettings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		
31 31
 		$grid->setModel(HomePage::create());
32 32
 
33
-		$grid->addDragHandler()->onReorder(function ($order) {
33
+		$grid->addDragHandler()->onReorder(function($order) {
34 34
 			$result = true;
35 35
 			foreach (HomePage::create() as $homepage) {
36 36
 				$homepage['priority'] = array_search($homepage['id'], $order);
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 				$result &= $homepage->save();
39 39
 			}
40 40
 			
41
-			return $result? $this->notify(__('Homepages reordered!')): $this->notifyError(__('Error saving order!'));
41
+			return $result ? $this->notify(__('Homepages reordered!')) : $this->notifyError(__('Error saving order!'));
42 42
 		});
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.
src/Controllers/SystemController.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -11,66 +11,66 @@
 block discarded – undo
11 11
 
12 12
 class SystemController extends Controller
13 13
 {
14
-    public function index()
15
-    {
16
-    	return SystemCore::isInstalled()? redirect('home'): redirect('install');
17
-    }
14
+	public function index()
15
+	{
16
+		return SystemCore::isInstalled()? redirect('home'): redirect('install');
17
+	}
18 18
     
19
-    public function install(Epesi $epesi)
20
-    {
21
-    	// make sure the installation information is fresh
22
-    	ModuleManager::clearCache();
19
+	public function install(Epesi $epesi)
20
+	{
21
+		// make sure the installation information is fresh
22
+		ModuleManager::clearCache();
23 23
     	
24
-    	if (SystemCore::isInstalled()) return redirect('home');
24
+		if (SystemCore::isInstalled()) return redirect('home');
25 25
     	
26
-    	$epesi->title = __(':epesi > Installation', ['epesi' => config('epesi.app.title')]);
26
+		$epesi->title = __(':epesi > Installation', ['epesi' => config('epesi.app.title')]);
27 27
     	
28
-    	$epesi->initLayout('Centered');
28
+		$epesi->initLayout('Centered');
29 29
     	
30
-    	$epesi->layout->set('logo', url('logo'));
31
-    	$epesi->layout->template->setHTML('copyright', config('epesi.app.copyright'));
30
+		$epesi->layout->set('logo', url('logo'));
31
+		$epesi->layout->template->setHTML('copyright', config('epesi.app.copyright'));
32 32
     	
33
-    	$epesi->add(new \Epesi\Core\System\SystemInstallWizard());
33
+		$epesi->add(new \Epesi\Core\System\SystemInstallWizard());
34 34
     	
35
-    	return $epesi->response();
36
-    }
35
+		return $epesi->response();
36
+	}
37 37
     
38
-    public function home()
39
-    {
40
-    	return redirect(SystemCore::isInstalled()? \Epesi\Core\HomePage\Database\Models\HomePage::pathOfUser(): 'install');
41
-    }
38
+	public function home()
39
+	{
40
+		return redirect(SystemCore::isInstalled()? \Epesi\Core\HomePage\Database\Models\HomePage::pathOfUser(): 'install');
41
+	}
42 42
     
43
-    public function logo()
44
-    { 
45
-    	$logoFile = \Epesi\Core\System\Logo\LogoSettings::getLogoFile();
43
+	public function logo()
44
+	{ 
45
+		$logoFile = \Epesi\Core\System\Logo\LogoSettings::getLogoFile();
46 46
 
47
-    	return response(File::get($logoFile), 200, ['Content-type' => File::mimeType($logoFile)])->setMaxAge(604800)->setPublic();
48
-    }
47
+		return response(File::get($logoFile), 200, ['Content-type' => File::mimeType($logoFile)])->setMaxAge(604800)->setPublic();
48
+	}
49 49
     
50
-    public function view(Epesi $epesi, $module, $method = 'body', $args = [])
51
-    {
52
-    	$epesi->initLayout(new LayoutView());
50
+	public function view(Epesi $epesi, $module, $method = 'body', $args = [])
51
+	{
52
+		$epesi->initLayout(new LayoutView());
53 53
     	
54
-    	$alias = explode(':', $module);
54
+		$alias = explode(':', $module);
55 55
     	
56
-    	$moduleAlias = $alias[0];
57
-    	$viewAlias = $alias[1]?? null;
56
+		$moduleAlias = $alias[0];
57
+		$viewAlias = $alias[1]?? null;
58 58
     	
59
-    	$view = null;
60
-    	if ($module = ModuleManager::getClass($moduleAlias, true)) {
61
-    		$viewClass = $module::view($viewAlias);
59
+		$view = null;
60
+		if ($module = ModuleManager::getClass($moduleAlias, true)) {
61
+			$viewClass = $module::view($viewAlias);
62 62
 
63
-    		if (class_exists($viewClass)) {
64
-    			$view = new $viewClass();
65
-    		}
66
-    	}
63
+			if (class_exists($viewClass)) {
64
+				$view = new $viewClass();
65
+			}
66
+		}
67 67
 
68
-    	if (! $view) abort(404);
68
+		if (! $view) abort(404);
69 69
     	
70
-    	$epesi->add($view)->displayModuleContent($method, $args);
70
+		$epesi->add($view)->displayModuleContent($method, $args);
71 71
     	
72
-    	$epesi->setLocation($view->location());
72
+		$epesi->setLocation($view->location());
73 73
     	
74
-    	return $epesi->response();
75
-    }
74
+		return $epesi->response();
75
+	}
76 76
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 {
14 14
     public function index()
15 15
     {
16
-    	return SystemCore::isInstalled()? redirect('home'): redirect('install');
16
+    	return SystemCore::isInstalled() ? redirect('home') : redirect('install');
17 17
     }
18 18
     
19 19
     public function install(Epesi $epesi)
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     
38 38
     public function home()
39 39
     {
40
-    	return redirect(SystemCore::isInstalled()? \Epesi\Core\HomePage\Database\Models\HomePage::pathOfUser(): 'install');
40
+    	return redirect(SystemCore::isInstalled() ? \Epesi\Core\HomePage\Database\Models\HomePage::pathOfUser() : 'install');
41 41
     }
42 42
     
43 43
     public function logo()
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     		}
66 66
     	}
67 67
 
68
-    	if (! $view) abort(404);
68
+    	if (!$view) abort(404);
69 69
     	
70 70
     	$epesi->add($view)->displayModuleContent($method, $args);
71 71
     	
Please login to merge, or discard this patch.