Passed
Push — master ( 7c65be...4954b5 )
by Georgi
04:05
created
src/Providers/AdminServiceProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     	$this->loadMigrationsFrom(ModuleManager::collect('migrations'));
30 30
 
31 31
     	// Publish epesi configuration files
32
-    	$this->publishes([__DIR__.'/../../config' => config_path()], 'epesi.config');
32
+    	$this->publishes([__DIR__ . '/../../config' => config_path()], 'epesi.config');
33 33
     }
34 34
 
35 35
     /**
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -20,25 +20,25 @@
 block discarded – undo
20 20
 			ModuleInstallCommand::class
21 21
 	];
22 22
 	
23
-    /**
24
-     * Booting the package.
25
-     */
26
-    public function boot()
27
-    {
28
-    	$this->app->register(\JoeDixon\Translation\TranslationServiceProvider::class);
23
+	/**
24
+	 * Booting the package.
25
+	 */
26
+	public function boot()
27
+	{
28
+		$this->app->register(\JoeDixon\Translation\TranslationServiceProvider::class);
29 29
     	
30
-    	// Register migrations from installed modules
31
-    	$this->loadMigrationsFrom(ModuleManager::collect('migrations'));
30
+		// Register migrations from installed modules
31
+		$this->loadMigrationsFrom(ModuleManager::collect('migrations'));
32 32
 
33
-    	// Publish epesi configuration files
34
-    	$this->publishes([__DIR__.'/../../config' => config_path()], 'epesi.config');
35
-    }
33
+		// Publish epesi configuration files
34
+		$this->publishes([__DIR__.'/../../config' => config_path()], 'epesi.config');
35
+	}
36 36
 
37
-    /**
38
-     * Register the provider.
39
-     */
40
-    public function register()
41
-    {
42
-    	$this->commands($this->commands);
43
-    }
37
+	/**
38
+	 * Register the provider.
39
+	 */
40
+	public function register()
41
+	{
42
+		$this->commands($this->commands);
43
+	}
44 44
 }
Please login to merge, or discard this patch.
src/Layout/Seeds/RightMenu.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 				'title' => __('Launchpad'),
39 39
 		]);
40 40
 		
41
-		foreach(UserMenuJoint::collect() as $joint) {
42
-			foreach ($joint->tools()?: [] as $tool) {
41
+		foreach (UserMenuJoint::collect() as $joint) {
42
+			foreach ($joint->tools() ?: [] as $tool) {
43 43
 				$this->addTool($tool);
44 44
 			}
45 45
 
46
-			foreach ($joint->entries()?: [] as $entry) {
46
+			foreach ($joint->entries() ?: [] as $entry) {
47 47
 				$this->addEntry($entry);
48 48
 			}			
49 49
 		}
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 				'item' => ['Logout', 'icon' => 'sign out', 'attr' => ['onclick' => "event.preventDefault();$('#logout-form').submit();"]],
62 62
 				'action' => url('logout'), 
63 63
 				'group' => '10000:user',
64
-				'callback' => function ($item){
64
+				'callback' => function($item) {
65 65
 					$logoutForm = $item->add(['View', 'attr' => ['method' => 'POST', 'action' => URL::to('logout')]])->setElement('form')->addStyle(['display' => 'none']);
66 66
 					$logoutForm->id = 'logout-form';
67 67
 					$logoutForm->add(['View', 'attr' => ['type' => 'hidden', 'name' => '_token', 'value' => csrf_token()]])->setElement('input');
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 	
79 79
 	public function getUserMenuLabel()
80 80
 	{
81
-		return $this->userMenuLabel?: Auth::user()->name;
81
+		return $this->userMenuLabel ?: Auth::user()->name;
82 82
 	}
83 83
 	
84 84
 	public function addEntry($entry)
85 85
 	{
86 86
 		$entry = collect(array_merge(['item' => $entry, 'group' => '00500:general', 'weight' => 10], $entry));
87 87
 		
88
-		if (! $entry->get('item')) return;
88
+		if (!$entry->get('item')) return;
89 89
 		
90 90
 		$this->entries->add($entry);
91 91
 	}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 				
114 114
 				$item = $this->userMenu->addItem($entry['item'], $entry->get('action'));
115 115
 				
116
-				if (! $callback = $entry->get('callback')) continue;
116
+				if (!$callback = $entry->get('callback')) continue;
117 117
 					
118 118
 				$callback($item);
119 119
 			}
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,7 +73,9 @@  discard block
 block discarded – undo
73 73
 	{
74 74
 		$entry = collect(array_merge(['item' => $entry, 'group' => '00500:general', 'weight' => 10], $entry));
75 75
 		
76
-		if (! $entry->get('item')) return;
76
+		if (! $entry->get('item')) {
77
+			return;
78
+		}
77 79
 		
78 80
 		$this->entries->add($entry);
79 81
 	}
@@ -94,14 +96,18 @@  discard block
 block discarded – undo
94 96
 	{
95 97
 		$empty = true;
96 98
 		foreach ($this->entries->groupBy('group')->sortKeys() as $group) {
97
-			if (!$empty) $this->userMenu->addDivider();
99
+			if (!$empty) {
100
+				$this->userMenu->addDivider();
101
+			}
98 102
 		
99 103
 			foreach ($group->sortBy('weight') as $entry) {
100 104
 				$empty = false;
101 105
 				
102 106
 				$item = $this->userMenu->addItem($entry['item'], $entry->get('action'));
103 107
 				
104
-				if (! $callback = $entry->get('callback')) continue;
108
+				if (! $callback = $entry->get('callback')) {
109
+					continue;
110
+				}
105 111
 					
106 112
 				$callback($item);
107 113
 			}
Please login to merge, or discard this patch.
src/Layout/Seeds/ActionBar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	
59 59
 	protected function prepareButtons()
60 60
 	{
61
-		foreach (self::$buttons->sortByDesc(function ($button) {
61
+		foreach (self::$buttons->sortByDesc(function($button) {
62 62
 			return $button->weight;
63 63
 		}) as $button) {
64 64
 			$this->add($button);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	
83 83
 	public static function addButtons($buttons)
84 84
 	{
85
-		foreach (is_array($buttons)? $buttons: [$buttons] as $button) {
85
+		foreach (is_array($buttons) ? $buttons : [$buttons] as $button) {
86 86
 			self::addButton($button);
87 87
 		}
88 88
 	}
Please login to merge, or discard this patch.
src/Layout/Seeds/LaunchPad.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	
14 14
 	public function __construct($parent)
15 15
 	{
16
-    	$this->parent = $parent;
16
+		$this->parent = $parent;
17 17
     	
18 18
 		parent::__construct('$(this).atkCreateModal([arg])', [
19 19
 				'arg' => [
@@ -25,29 +25,29 @@  discard block
 block discarded – undo
25 25
 	}
26 26
     
27 27
 	protected function getURL()
28
-    {
29
-    	return $this->parent->add('VirtualPage')->set(Closure::fromCallable([$this, 'getContents']))->getJSURL('cut');
30
-    }
28
+	{
29
+		return $this->parent->add('VirtualPage')->set(Closure::fromCallable([$this, 'getContents']))->getJSURL('cut');
30
+	}
31 31
     
32
-    protected function getContents(VirtualPage $vp)
33
-    {
34
-    	$vp->add([
35
-    			new LaunchButton([
36
-    					'label' => 'Test Button 1',
37
-    					'icon' => 'user'
38
-    			])
39
-    	])->link(URL::to('/'));
40
-    	$vp->add([
41
-    			new LaunchButton([
42
-    					'label' => 'Test Button 2',
43
-    					'icon' => 'car'
44
-    			])
45
-    	]);
46
-    	$vp->add([
47
-    			new LaunchButton([
48
-    					'label' => 'Test Button 3',
49
-    					'icon' => 'bus'
50
-    			])
51
-    	]);
52
-    }
32
+	protected function getContents(VirtualPage $vp)
33
+	{
34
+		$vp->add([
35
+				new LaunchButton([
36
+						'label' => 'Test Button 1',
37
+						'icon' => 'user'
38
+				])
39
+		])->link(URL::to('/'));
40
+		$vp->add([
41
+				new LaunchButton([
42
+						'label' => 'Test Button 2',
43
+						'icon' => 'car'
44
+				])
45
+		]);
46
+		$vp->add([
47
+				new LaunchButton([
48
+						'label' => 'Test Button 3',
49
+						'icon' => 'bus'
50
+				])
51
+		]);
52
+	}
53 53
 }
Please login to merge, or discard this patch.
src/Layout/Seeds/NavMenu.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		$this->addHeader($this->app->title);
20 20
 		
21 21
 		$items = collect();
22
-		foreach(NavMenuJoint::collect() as $joint) {
22
+		foreach (NavMenuJoint::collect() as $joint) {
23 23
 			$items = $items->merge($joint->items());
24 24
 		}
25 25
 
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 	
37 37
 	public static function addItems($menu, Collection $items)
38 38
 	{
39
-		$items->sort(function ($entry1, $entry2) {
39
+		$items->sort(function($entry1, $entry2) {
40 40
 			$weight1 = $entry1['weight']?? 10;
41 41
 			$weight2 = $entry2['weight']?? 10;
42 42
 			
43 43
 			return $weight1 <=> $weight2;
44 44
 		})->map(function($item, $caption) use ($menu) {
45
-			if (! ($item['access']?? true)) return;
45
+			if (!($item['access']?? true)) return;
46 46
 			
47 47
 			if (!isset($item['link']) && !is_array($item)) {
48 48
 				$item = [
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,7 +42,9 @@  discard block
 block discarded – undo
42 42
 			
43 43
 			return $weight1 <=> $weight2;
44 44
 		})->map(function($item, $caption) use ($menu) {
45
-			if (! ($item['access']?? true)) return;
45
+			if (! ($item['access']?? true)) {
46
+				return;
47
+			}
46 48
 			
47 49
 			if (!isset($item['link']) && !is_array($item)) {
48 50
 				$item = [
@@ -60,8 +62,7 @@  discard block
 block discarded – undo
60 62
 				$submenu = $menu->addMenu($item['caption']);
61 63
 				
62 64
 				self::addItems($submenu, collect($subitems));
63
-			}
64
-			elseif ($subitems = $item['group']?? []) {
65
+			} elseif ($subitems = $item['group']?? []) {
65 66
 				$subgroup = $menu->addGroup($item['caption']);
66 67
 				
67 68
 				if (($item['toggle']?? false) && !$menu->in_dropdown) {
@@ -70,8 +71,7 @@  discard block
 block discarded – undo
70 71
 				}
71 72
 				
72 73
 				self::addItems($subgroup, collect($subitems));
73
-			}
74
-			elseif ($subitems = $item['accordion']?? []) {
74
+			} elseif ($subitems = $item['accordion']?? []) {
75 75
 				$accordion = $menu->add(['Accordion']);
76 76
 				
77 77
 				$section = $accordion->addSection($item['caption']);
@@ -94,12 +94,10 @@  discard block
 block discarded – undo
94 94
 					}
95 95
 				}
96 96
 // 				self::addItems($accordion, collect($subitems));
97
-			}
98
-			else {
97
+			} else {
99 98
 				if (is_a($menu, Accordion::class)) {
100 99
 					$menu->add(['View', 'Test']);
101
-				}
102
-				else {
100
+				} else {
103 101
 					$menu->addItem($item['caption'], $item['link']?? '');
104 102
 				}
105 103
 				
Please login to merge, or discard this patch.
src/Console/SetEnvCommand.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -6,48 +6,48 @@
 block discarded – undo
6 6
 
7 7
 class SetEnvCommand extends Command
8 8
 {
9
-    /**
10
-     * The name and signature of the console command.
11
-     *
12
-     * @var string
13
-     */
14
-    protected $signature = 'epesi:env {name : Env variable(s) to set} {value? : Env variable value}';
9
+	/**
10
+	 * The name and signature of the console command.
11
+	 *
12
+	 * @var string
13
+	 */
14
+	protected $signature = 'epesi:env {name : Env variable(s) to set} {value? : Env variable value}';
15 15
 
16
-    /**
17
-     * The console command description.
18
-     *
19
-     * @var string
20
-     */
21
-    protected $description = 'Update ENV variable';
16
+	/**
17
+	 * The console command description.
18
+	 *
19
+	 * @var string
20
+	 */
21
+	protected $description = 'Update ENV variable';
22 22
 
23
-    /**
24
-     * Execute the console command.
25
-     */
26
-    public function handle()
27
-    {
28
-    	$this->setEnv($this->argument('name'), $this->argument('value'));
29
-    }
23
+	/**
24
+	 * Execute the console command.
25
+	 */
26
+	public function handle()
27
+	{
28
+		$this->setEnv($this->argument('name'), $this->argument('value'));
29
+	}
30 30
     
31
-    private static function setEnv($name, $value = null)
32
-    {
33
-    	$env = $name;
34
-    	if (is_string($name) && !isset($value)) {
35
-    		$env = [
36
-    				$name => $value
37
-    		];
38
-    	}
31
+	private static function setEnv($name, $value = null)
32
+	{
33
+		$env = $name;
34
+		if (is_string($name) && !isset($value)) {
35
+			$env = [
36
+					$name => $value
37
+			];
38
+		}
39 39
     	
40
-    	foreach ($env as $key => $value) {
41
-    		$oldSetting = $key . '=' . env($key);
42
-    		$newSetting = $key . '=' . $value;
40
+		foreach ($env as $key => $value) {
41
+			$oldSetting = $key . '=' . env($key);
42
+			$newSetting = $key . '=' . $value;
43 43
     		
44
-    		putenv($newSetting);
44
+			putenv($newSetting);
45 45
     		
46
-    		file_put_contents(app()->environmentFilePath(), str_replace(
47
-    			$oldSetting,
48
-    			$newSetting,
49
-    			file_get_contents(app()->environmentFilePath())
50
-    		));
51
-    	}
52
-    }
46
+			file_put_contents(app()->environmentFilePath(), str_replace(
47
+				$oldSetting,
48
+				$newSetting,
49
+				file_get_contents(app()->environmentFilePath())
50
+			));
51
+		}
52
+	}
53 53
 }
Please login to merge, or discard this patch.
src/System/Database/Migrations/2019_09_18_173148_create_core_tables.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -6,37 +6,37 @@
 block discarded – undo
6 6
 
7 7
 class CreateCoreTables 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('variables', function (Blueprint $table) {
19
-            $table->string('name', 128)->primary();
20
-            $table->text('value');
21
-        });
18
+		Schema::create('variables', function (Blueprint $table) {
19
+			$table->string('name', 128)->primary();
20
+			$table->text('value');
21
+		});
22 22
     	
23
-    	Schema::create('modules', function (Blueprint $table) {
24
-            $table->string('class', 512);
25
-            $table->string('alias', 128)->unique();
26
-            $table->smallInteger('priority')->default(0);
27
-            $table->smallInteger('state')->default(1);
28
-        });
29
-    }
23
+		Schema::create('modules', function (Blueprint $table) {
24
+			$table->string('class', 512);
25
+			$table->string('alias', 128)->unique();
26
+			$table->smallInteger('priority')->default(0);
27
+			$table->smallInteger('state')->default(1);
28
+		});
29
+	}
30 30
 
31
-    /**
32
-     * Reverse the migrations.
33
-     *
34
-     * @return void
35
-     */
36
-    public function down()
37
-    {
38
-    	Schema::dropIfExists('variables');
31
+	/**
32
+	 * Reverse the migrations.
33
+	 *
34
+	 * @return void
35
+	 */
36
+	public function down()
37
+	{
38
+		Schema::dropIfExists('variables');
39 39
     	
40
-    	Schema::dropIfExists('modules');
41
-    }
40
+		Schema::dropIfExists('modules');
41
+	}
42 42
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
     {
16 16
     	$this->down();
17 17
     	
18
-    	Schema::create('variables', function (Blueprint $table) {
18
+    	Schema::create('variables', function(Blueprint $table) {
19 19
             $table->string('name', 128)->primary();
20 20
             $table->text('value');
21 21
         });
22 22
     	
23
-    	Schema::create('modules', function (Blueprint $table) {
23
+    	Schema::create('modules', function(Blueprint $table) {
24 24
             $table->string('class', 512);
25 25
             $table->string('alias', 128)->unique();
26 26
             $table->smallInteger('priority')->default(0);
Please login to merge, or discard this patch.
src/System/Integration/Modules/Concerns/HasMigrations.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	{
21 21
 		$paths = $this->migrations();
22 22
 		
23
-		foreach (is_array($paths)? $paths: [$paths] as $path) {
23
+		foreach (is_array($paths) ? $paths : [$paths] as $path) {
24 24
 			\Illuminate\Support\Facades\Artisan::call('migrate', ['--path' => $path, '--force' => true]);
25 25
 		}
26 26
 		
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	{
32 32
 		$paths = $this->migrations();
33 33
 		
34
-		foreach (is_array($paths)? $paths: [$paths] as $path) {
34
+		foreach (is_array($paths) ? $paths : [$paths] as $path) {
35 35
 			\Illuminate\Support\Facades\Artisan::call('migrate:rollback', ['--path' => $path]);
36 36
 		}
37 37
 		
Please login to merge, or discard this patch.
HomePage/Database/Migrations/2019_09_18_173158_create_homepage_table.php 2 patches
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.
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')->default(0);
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')->default(0);
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.