Passed
Push — master ( 195422...889b95 )
by Georgi
03:03
created
src/Controllers/HomeController.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@
 block discarded – undo
8 8
 
9 9
 class HomeController extends Controller
10 10
 {
11
-    public function index()
12
-    {
13
-    	return SystemCore::isInstalled()? redirect()->route('home'): redirect('install');
14
-    }
11
+	public function index()
12
+	{
13
+		return SystemCore::isInstalled()? redirect()->route('home'): redirect('install');
14
+	}
15 15
     
16
-    public function home()
17
-    {
18
-    	return redirect(HomePageCommon::getUserHomePage()->path);
19
-    }
16
+	public function home()
17
+	{
18
+		return redirect(HomePageCommon::getUserHomePage()->path);
19
+	}
20 20
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
     public function index()
12 12
     {
13
-    	return SystemCore::isInstalled()? redirect()->route('home'): redirect('install');
13
+    	return SystemCore::isInstalled() ? redirect()->route('home') : redirect('install');
14 14
     }
15 15
     
16 16
     public function home()
Please login to merge, or discard this patch.
HomePage/Database/Migrations/2019_09_18_173158_create_homepage_table.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@
 block discarded – undo
6 6
 
7 7
 class CreateHomePageTable 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('home_pages', function (Blueprint $table) {
19
-    		$table->increments('id');
20
-            $table->string('path', 64);
21
-            $table->string('role', 64);
22
-            $table->smallInteger('priority');
23
-        });
24
-    }
18
+		Schema::create('home_pages', function (Blueprint $table) {
19
+			$table->increments('id');
20
+			$table->string('path', 64);
21
+			$table->string('role', 64);
22
+			$table->smallInteger('priority');
23
+		});
24
+	}
25 25
 
26
-    /**
27
-     * Reverse the migrations.
28
-     *
29
-     * @return void
30
-     */
31
-    public function down()
32
-    {
33
-    	Schema::dropIfExists('home_pages'); 	
34
-    }
26
+	/**
27
+	 * Reverse the migrations.
28
+	 *
29
+	 * @return void
30
+	 */
31
+	public function down()
32
+	{
33
+		Schema::dropIfExists('home_pages'); 	
34
+	}
35 35
 }
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('home_pages', function (Blueprint $table) {
18
+    	Schema::create('home_pages', function(Blueprint $table) {
19 19
     		$table->increments('id');
20 20
             $table->string('path', 64);
21 21
             $table->string('role', 64);
Please login to merge, or discard this patch.
src/HomePage/HomePageCommon.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	{
18 18
 		static $cache;
19 19
 		
20
-		if (! isset($cache)) {
20
+		if (!isset($cache)) {
21 21
 			$cache = [];
22 22
 			foreach (HomePageJoint::collect() as $joint) {
23 23
 				$cache[$joint->link()] = $joint->caption();
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public static function getUserHomePage()
36 36
 	{
37
-		if (! $user = Auth::user()) return;
37
+		if (!$user = Auth::user()) return;
38 38
 
39 39
 		return HomePage::whereIn('role', $user->roles()->pluck('name'))->orderBy('priority')->first();
40 40
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,9 @@
 block discarded – undo
34 34
 	 */
35 35
 	public static function getUserHomePage()
36 36
 	{
37
-		if (! $user = Auth::user()) return;
37
+		if (! $user = Auth::user()) {
38
+			return;
39
+		}
38 40
 
39 41
 		return HomePage::whereIn('role', $user->roles()->pluck('name'))->orderBy('priority')->first();
40 42
 	}
Please login to merge, or discard this patch.
src/HomePage/HomePageSettings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 			return [['Template', $availablePages[$row[$column]]]];
46 46
 		}]);
47 47
 		
48
-		$this->grid->addDragHandler()->onReorder(function ($order) {
48
+		$this->grid->addDragHandler()->onReorder(function($order) {
49 49
 			$result = true;
50 50
 			foreach ($this->getHomepages() as $homepage) {
51 51
 				$homepage->priority = array_search($homepage->id, $order);
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 				$result &= $homepage->save();
54 54
 			}
55 55
 			
56
-			return $result? $this->notify(__('Homepages reordered!')): $this->notifyError(__('Error saving order!'));
56
+			return $result ? $this->notify(__('Homepages reordered!')) : $this->notifyError(__('Error saving order!'));
57 57
 		});
58 58
 		
59
-		$this->grid->addAction(['icon' => 'red trash'], function ($jschain, $id) {
59
+		$this->grid->addAction(['icon' => 'red trash'], function($jschain, $id) {
60 60
 			HomePage::find($id)->delete();
61 61
 				
62 62
 			return $jschain->closest('tr')->transition('fade left');
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	
93 93
 	public function getHomepageForm()
94 94
 	{
95
-		if (! $this->form) {		
95
+		if (!$this->form) {		
96 96
 			$this->form = new Form(['buttonSave' => ['Button', __('Save'), 'primary']]);
97 97
 	
98 98
 			$this->form->addHook('submit', function($form) {
Please login to merge, or discard this patch.
src/Providers/EpesiServiceProvider.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -9,66 +9,66 @@
 block discarded – undo
9 9
 
10 10
 class EpesiServiceProvider extends ServiceProvider
11 11
 {
12
-    /**
13
-     * Booting the package.
14
-     */
15
-    public function boot()
16
-    {
17
-    	$this->ensureHttps();
12
+	/**
13
+	 * Booting the package.
14
+	 */
15
+	public function boot()
16
+	{
17
+		$this->ensureHttps();
18 18
     	
19
-    	Route::group(['namespace' => 'Epesi\Core\Controllers', 'middleware' => 'web'], function() {
20
-    		header("Cache-Control: no-cache, no-store, must-revalidate"); //HTTP 1.1
21
-    		header("Pragma: no-cache"); //HTTP 1.0
22
-    		header("Expires: 0");
19
+		Route::group(['namespace' => 'Epesi\Core\Controllers', 'middleware' => 'web'], function() {
20
+			header("Cache-Control: no-cache, no-store, must-revalidate"); //HTTP 1.1
21
+			header("Pragma: no-cache"); //HTTP 1.0
22
+			header("Expires: 0");
23 23
 
24
-    		Route::any('/', 'HomeController@index');
25
-    		Route::any('install', 'InstallController@index');
24
+			Route::any('/', 'HomeController@index');
25
+			Route::any('install', 'InstallController@index');
26 26
     		
27
-    		Route::group(['middleware' => 'auth'], function() {
28
-    			Route::any('home', 'HomeController@home')->name('home');
27
+			Route::group(['middleware' => 'auth'], function() {
28
+				Route::any('home', 'HomeController@home')->name('home');
29 29
     			
30
-    			Route::any('view/{alias}/{method?}/{args?}', 'ModuleController@view');
31
-    		});
32
-    	});
30
+				Route::any('view/{alias}/{method?}/{args?}', 'ModuleController@view');
31
+			});
32
+		});
33 33
 
34
-    	// call boot methods on all modules
35
-    	ModuleManager::call('boot');
34
+		// call boot methods on all modules
35
+		ModuleManager::call('boot');
36 36
     		
37 37
 		foreach (ModuleManager::collect('translations') as $path) {
38 38
 			$this->loadJsonTranslationsFrom($path);
39 39
 		}
40 40
 		
41
-    	// Register admin service provider if in admin mode or in console
42
-    	// TODO: apply access restriction to admin mode
41
+		// Register admin service provider if in admin mode or in console
42
+		// TODO: apply access restriction to admin mode
43 43
 //     	if ($this->app->runningInConsole() || (request('admin', false) && Auth::user()->can('modify system'))) {
44
-    	if ($this->app->runningInConsole() || request('admin', false)) {
45
-    		$this->app->register(AdminServiceProvider::class);
46
-    	}
47
-    }
44
+		if ($this->app->runningInConsole() || request('admin', false)) {
45
+			$this->app->register(AdminServiceProvider::class);
46
+		}
47
+	}
48 48
 
49
-    /**
50
-     * Register the provider.
51
-     */
52
-    public function register()
53
-    {
54
-    	$this->app->singleton(App::class);
55
-    }
49
+	/**
50
+	 * Register the provider.
51
+	 */
52
+	public function register()
53
+	{
54
+		$this->app->singleton(App::class);
55
+	}
56 56
     
57
-    /**
58
-     * Force to set https scheme if https enabled.
59
-     *
60
-     * @return void
61
-     */
62
-    protected function ensureHttps()
63
-    {
64
-    	if (config('epesi.https') || config('epesi.secure')) {
65
-    		url()->forceScheme('https');
66
-    		$this->app['request']->server->set('HTTPS', true);
67
-    	}
68
-    }
57
+	/**
58
+	 * Force to set https scheme if https enabled.
59
+	 *
60
+	 * @return void
61
+	 */
62
+	protected function ensureHttps()
63
+	{
64
+		if (config('epesi.https') || config('epesi.secure')) {
65
+			url()->forceScheme('https');
66
+			$this->app['request']->server->set('HTTPS', true);
67
+		}
68
+	}
69 69
     
70
-    protected function registerStorageDisk()
71
-    {
72
-    	$this->app['config']['filesystems.disks.epesi'] = config('epesi.disk');
73
-    }
70
+	protected function registerStorageDisk()
71
+	{
72
+		$this->app['config']['filesystems.disks.epesi'] = config('epesi.disk');
73
+	}
74 74
 }
Please login to merge, or discard this patch.