Test Setup Failed
Branch master (7bbbd5)
by Georgi
03:54
created
src/Database/Models/Module.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 	private static $cache;
15 15
 	
16 16
 	private static function cache() {
17
-		if(isset(self::$cache)) return;
17
+		if (isset(self::$cache)) return;
18 18
 		
19 19
 		self::$cache = self::pluck('class', 'alias');
20 20
 	}
21 21
 	
22 22
 	public static function isInstalled($classOrAlias) {
23
-		return self::getClass($classOrAlias)? 1: 0;
23
+		return self::getClass($classOrAlias) ? 1 : 0;
24 24
 	}
25 25
 	
26 26
 	public static function getClass($classOrAlias) {
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 	{
48 48
 		$ret = [];
49 49
 		foreach (self::getInstalled() as $module) {
50
-			if (! $list = $module::$method()) continue;
50
+			if (!$list = $module::$method()) continue;
51 51
 			
52
-			$ret = array_merge($ret, is_array($list)? $list: [$list]);
52
+			$ret = array_merge($ret, is_array($list) ? $list : [$list]);
53 53
 		}
54 54
 		
55 55
 		return $ret;
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@  discard block
 block discarded – undo
14 14
 	private static $cache;
15 15
 	
16 16
 	private static function cache() {
17
-		if(isset(self::$cache)) return;
17
+		if(isset(self::$cache)) {
18
+			return;
19
+		}
18 20
 		
19 21
 		self::$cache = self::pluck('class', 'alias');
20 22
 	}
@@ -26,7 +28,9 @@  discard block
 block discarded – undo
26 28
 	public static function getClass($classOrAlias) {
27 29
 		self::cache();
28 30
 		
29
-		if (self::$cache->contains($classOrAlias)) return $classOrAlias;
31
+		if (self::$cache->contains($classOrAlias)) {
32
+			return $classOrAlias;
33
+		}
30 34
 		
31 35
 		return self::$cache[$classOrAlias]?? null;
32 36
 	}
@@ -47,7 +51,9 @@  discard block
 block discarded – undo
47 51
 	{
48 52
 		$ret = [];
49 53
 		foreach (self::getInstalled() as $module) {
50
-			if (! $list = $module::$method()) continue;
54
+			if (! $list = $module::$method()) {
55
+				continue;
56
+			}
51 57
 			
52 58
 			$ret = array_merge($ret, is_array($list)? $list: [$list]);
53 59
 		}
Please login to merge, or discard this patch.
src/Database/Models/Variable.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	private static $variables;
18 18
 	
19 19
 	private static function cache() {
20
-		if(isset(self::$variables)) return;
20
+		if (isset(self::$variables)) return;
21 21
 		
22 22
 		self::$variables = self::pluck('value', 'name');
23 23
 	}
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	public static function get($name, $throwError = true) {
26 26
 		self::cache();
27 27
 		
28
-		if (! self::$variables->has($name) && $throwError) {
28
+		if (!self::$variables->has($name) && $throwError) {
29 29
 			throw new \Exception('No such variable in database: ' . $name);
30 30
 		}
31 31
 		
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 		return self::updateOrCreate(compact('name'), compact('value'));
47 47
 	}
48 48
 	
49
-	public static function forget($name, $throwError=true) {
49
+	public static function forget($name, $throwError = true) {
50 50
 		self::cache();
51 51
 		
52
-		if (! self::$variables->has($name) && $throwError) {
52
+		if (!self::$variables->has($name) && $throwError) {
53 53
 			throw new \Exception('No such variable in database: ' . $name);
54 54
 		}
55 55
 		
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,9 @@
 block discarded – undo
17 17
 	private static $variables;
18 18
 	
19 19
 	private static function cache() {
20
-		if(isset(self::$variables)) return;
20
+		if(isset(self::$variables)) {
21
+			return;
22
+		}
21 23
 		
22 24
 		self::$variables = self::pluck('value', 'name');
23 25
 	}
Please login to merge, or discard this patch.
src/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)->unique();
25
-            $table->string('alias', 128)->unique();
26
-            $table->smallInteger('priority');
27
-            $table->smallInteger('state');
28
-        });
29
-    }
23
+		Schema::create('modules', function (Blueprint $table) {
24
+			$table->string('class', 512)->unique();
25
+			$table->string('alias', 128)->unique();
26
+			$table->smallInteger('priority');
27
+			$table->smallInteger('state');
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)->unique();
25 25
             $table->string('alias', 128)->unique();
26 26
             $table->smallInteger('priority');
Please login to merge, or discard this patch.
src/Controllers/ModuleController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 			}
24 24
 		}
25 25
 
26
-		if (empty ($view)) abort(404);
26
+		if (empty ($view)) {
27
+			abort(404);
28
+		}
27 29
 
28 30
 		$epesi->add($view)->displayModuleContent($method, $args);
29 31
 		
Please login to merge, or discard this patch.
src/App.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 		//TODO: set the skin from admin / user selection
25 25
 		$skin = config('epesi.app.skin', $this->skin);
26 26
 		
27
-		$this->template_dir = $this->template_dir?: [];
27
+		$this->template_dir = $this->template_dir ?: [];
28 28
 		
29
-		$this->template_dir[] = __DIR__.'/UI/Templates/'. $skin;
29
+		$this->template_dir[] = __DIR__ . '/UI/Templates/' . $skin;
30 30
 		
31 31
 		parent::__construct([
32 32
 				'title' => config('epesi.app.title', 'EPESI'),
@@ -81,31 +81,31 @@  discard block
 block discarded – undo
81 81
 		//TODO: include below in app.js and app.css
82 82
 		// jQuery
83 83
 		$urlJs = $this->cdn['jquery']?? 'modules/system/js';
84
-		$this->requireJS($urlJs.'/jquery.min.js');
84
+		$this->requireJS($urlJs . '/jquery.min.js');
85 85
 		
86 86
 		// Semantic UI
87 87
 		$urlJs = $this->cdn['semantic-ui']?? 'modules/system/js';
88 88
 		$urlCss = $this->cdn['semantic-ui']?? 'modules/system/css';
89
-		$this->requireJS($urlJs.'/semantic.min.js');
90
-		$this->requireCSS($urlCss.'/semantic.min.css');
89
+		$this->requireJS($urlJs . '/semantic.min.js');
90
+		$this->requireCSS($urlCss . '/semantic.min.css');
91 91
 		
92 92
 		// Serialize Object
93 93
 		$urlJs = $this->cdn['serialize-object']?? 'modules/system/js';
94
-		$this->requireJS($urlJs.'/jquery.serialize-object.min.js');
94
+		$this->requireJS($urlJs . '/jquery.serialize-object.min.js');
95 95
 		
96 96
 		// Agile UI
97 97
 		$urlJs = $this->cdn['atk']?? 'modules/system/js';
98 98
 		$urlCss = $this->cdn['atk']?? 'modules/system/css';
99
-		$this->requireJS($urlJs.'/atkjs-ui.min.js');
100
-		$this->requireCSS($urlCss.'/agileui.css');
99
+		$this->requireJS($urlJs . '/atkjs-ui.min.js');
100
+		$this->requireCSS($urlCss . '/agileui.css');
101 101
 		
102 102
 		// Draggable
103 103
 		$urlJs = $this->cdn['draggable']?? 'modules/system/js';
104
-		$this->requireJS($urlJs.'/draggable.bundle.js');
104
+		$this->requireJS($urlJs . '/draggable.bundle.js');
105 105
 		
106 106
 		// jQuery UI	
107 107
 		$urlJs = $this->cdn['jquery-ui']?? 'modules/system/js';
108
-		$this->requireJS($urlJs.'/jquery-ui.js');
108
+		$this->requireJS($urlJs . '/jquery-ui.js');
109 109
 		
110 110
 // 		$this->requireJS('https://cdnjs.cloudflare.com/ajax/libs/jquery.nicescroll/3.7.6/jquery.nicescroll.min.js');
111 111
 	}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		
180 180
 		$key = md5(serialize(func_get_args()));
181 181
 		
182
-		if (! isset($cache[$key])) {
182
+		if (!isset($cache[$key])) {
183 183
 			$cache[$key] = true;
184 184
 			
185 185
 			parent::requireJS($url, $isAsync, $isDefer);
Please login to merge, or discard this patch.
src/UI/Seeds/RightMenu.php 2 patches
Spacing   +6 added lines, -6 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');
@@ -73,7 +73,7 @@  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')) return;
77 77
 		
78 78
 		$this->entries->add($entry);
79 79
 	}
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 				
102 102
 				$item = $this->userMenu->addItem($entry['item'], $entry->get('action'));
103 103
 				
104
-				if (! $callback = $entry->get('callback')) continue;
104
+				if (!$callback = $entry->get('callback')) continue;
105 105
 					
106 106
 				$callback($item);
107 107
 			}
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/UI/Seeds/LaunchButton.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,6 +4,6 @@
 block discarded – undo
4 4
 
5 5
 class LaunchButton extends ActionButton
6 6
 {
7
-    public $ui = 'basic launch pjax button';
7
+	public $ui = 'basic launch pjax button';
8 8
   
9 9
 }
Please login to merge, or discard this patch.
src/UI/Seeds/Form.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	protected $validationRules = [];
18 18
 	
19 19
 	public function addElements($elements, $parent = null) {
20
-		$parent = $parent?: $this;
20
+		$parent = $parent ?: $this;
21 21
 		
22 22
 		foreach ($elements as $name => $desc) {
23 23
 			$name = $desc['name']?? $name;
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 			
27 27
 			switch ($desc['type']?? 'field') {
28 28
 				case 'field':
29
-					$desc = is_string($desc)? [
29
+					$desc = is_string($desc) ? [
30 30
 					'decorator' => [$desc]
31
-					]: $desc;
31
+					] : $desc;
32 32
 					
33 33
 					$field = $parent->addField($name, $desc['decorator']?? [], $desc['options']?? []);
34 34
 					
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	}
78 78
 	
79 79
 	public function addFieldsDisplayRules($fieldsDisplayRules) {
80
-		$this->setFieldsDisplayRules(array_merge($this->fieldsDisplayRules?: [], $fieldsDisplayRules));
80
+		$this->setFieldsDisplayRules(array_merge($this->fieldsDisplayRules ?: [], $fieldsDisplayRules));
81 81
 	}
82 82
 	
83 83
 	public function addGroupDisplayRules($groupDisplayRules) {
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	}
90 90
 	
91 91
 	public function addFieldRules($field, $rules = []) {
92
-		if (! $rules) return;
92
+		if (!$rules) return;
93 93
 		
94 94
 		$this->fieldRules[$field] = $rules['rules']?? [
95 95
 				'identifier' => $field,
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 	
102 102
 	public function setValues($values)
103 103
 	{
104
-		foreach ($values?: [] as $name => $value) {
105
-			if (! $field = $this->fields[$name]?? null) continue;
104
+		foreach ($values ?: [] as $name => $value) {
105
+			if (!$field = $this->fields[$name]?? null) continue;
106 106
 			
107 107
 			$field->set($value);
108 108
 		}
@@ -125,17 +125,17 @@  discard block
 block discarded – undo
125 125
 				'fields' => $this->fieldRules
126 126
 		]);
127 127
 		
128
-		$this->onSubmit(function ($form) use ($callback) {
128
+		$this->onSubmit(function($form) use ($callback) {
129 129
 			$errors = [];
130
-			foreach ($this->validationRules?: [] as $ruleCallback) {
131
-				if (! is_callable($ruleCallback)) continue;
130
+			foreach ($this->validationRules ?: [] as $ruleCallback) {
131
+				if (!is_callable($ruleCallback)) continue;
132 132
 				
133 133
 				$ruleErrors = $ruleCallback($form);
134 134
 				
135
-				$errors = array_merge($errors, $ruleErrors?: []);
135
+				$errors = array_merge($errors, $ruleErrors ?: []);
136 136
 			}
137 137
 			
138
-			return $errors?: $callback($this);
138
+			return $errors ?: $callback($this);
139 139
 		});
140 140
 			
141 141
 			return $this;
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	
149 149
 	public function confirmLeave($confirm = true)
150 150
 	{
151
-		$this->canLeave = ! $confirm;
151
+		$this->canLeave = !$confirm;
152 152
 		
153 153
 		return $this;
154 154
 	}
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,7 +89,9 @@  discard block
 block discarded – undo
89 89
 	}
90 90
 	
91 91
 	public function addFieldRules($field, $rules = []) {
92
-		if (! $rules) return;
92
+		if (! $rules) {
93
+			return;
94
+		}
93 95
 		
94 96
 		$this->fieldRules[$field] = $rules['rules']?? [
95 97
 				'identifier' => $field,
@@ -102,7 +104,9 @@  discard block
 block discarded – undo
102 104
 	public function setValues($values)
103 105
 	{
104 106
 		foreach ($values?: [] as $name => $value) {
105
-			if (! $field = $this->fields[$name]?? null) continue;
107
+			if (! $field = $this->fields[$name]?? null) {
108
+				continue;
109
+			}
106 110
 			
107 111
 			$field->set($value);
108 112
 		}
@@ -128,7 +132,9 @@  discard block
 block discarded – undo
128 132
 		$this->onSubmit(function ($form) use ($callback) {
129 133
 			$errors = [];
130 134
 			foreach ($this->validationRules?: [] as $ruleCallback) {
131
-				if (! is_callable($ruleCallback)) continue;
135
+				if (! is_callable($ruleCallback)) {
136
+					continue;
137
+				}
132 138
 				
133 139
 				$ruleErrors = $ruleCallback($form);
134 140
 				
Please login to merge, or discard this patch.
src/UI/Seeds/NavMenu.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 // 		$this->addHeader('')->addClass('recent');
21 21
 		
22 22
 		$items = collect();
23
-		foreach(NavMenuJoint::collect() as $joint) {
23
+		foreach (NavMenuJoint::collect() as $joint) {
24 24
 			$items = $items->merge($joint->items());
25 25
 		}
26 26
 
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 	
38 38
 	public static function addItems($menu, Collection $items)
39 39
 	{
40
-		$items->sort(function ($entry1, $entry2) {
40
+		$items->sort(function($entry1, $entry2) {
41 41
 			$weight1 = $entry1['weight']?? 10;
42 42
 			$weight2 = $entry2['weight']?? 10;
43 43
 			
44 44
 			return $weight1 <=> $weight2;
45 45
 		})->map(function($item, $caption) use ($menu) {
46
-			if (! ($item['access']?? true)) return;
46
+			if (!($item['access']?? true)) return;
47 47
 			
48 48
 			if (!isset($item['link']) && !is_array($item)) {
49 49
 				$item = [
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
 			
44 44
 			return $weight1 <=> $weight2;
45 45
 		})->map(function($item, $caption) use ($menu) {
46
-			if (! ($item['access']?? true)) return;
46
+			if (! ($item['access']?? true)) {
47
+				return;
48
+			}
47 49
 			
48 50
 			if (!isset($item['link']) && !is_array($item)) {
49 51
 				$item = [
@@ -61,8 +63,7 @@  discard block
 block discarded – undo
61 63
 				$submenu = $menu->addMenu($item['caption']);
62 64
 				
63 65
 				self::addItems($submenu, collect($subitems));
64
-			}
65
-			elseif ($subitems = $item['group']?? []) {
66
+			} elseif ($subitems = $item['group']?? []) {
66 67
 				$subgroup = $menu->addGroup($item['caption']);
67 68
 				
68 69
 				if (($item['toggle']?? false) && !$menu->in_dropdown) {
@@ -71,8 +72,7 @@  discard block
 block discarded – undo
71 72
 				}
72 73
 				
73 74
 				self::addItems($subgroup, collect($subitems));
74
-			}
75
-			elseif ($subitems = $item['accordion']?? []) {
75
+			} elseif ($subitems = $item['accordion']?? []) {
76 76
 				$accordion = $menu->add(['Accordion']);
77 77
 				
78 78
 				$section = $accordion->addSection($item['caption']);
@@ -98,12 +98,10 @@  discard block
 block discarded – undo
98 98
 				
99 99
 				
100 100
 // 				self::addItems($accordion, collect($subitems));
101
-			}
102
-			else {
101
+			} else {
103 102
 				if (is_a($menu, Accordion::class)) {
104 103
 					$menu->add(['View', 'Test']);
105
-				}
106
-				else {
104
+				} else {
107 105
 					$menu->addItem($item['caption'], $item['link']?? '');
108 106
 				}
109 107
 				
Please login to merge, or discard this patch.