Test Setup Failed
Push — master ( c5be4a...39e959 )
by Anton
02:54
created
www/engine/System/Classes/Utils/Form.php 1 patch
Braces   +17 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,11 @@  discard block
 block discarded – undo
23 23
 
24 24
 			$text = Language::get($phrase);
25 25
 
26
-			if (!$popup) Messages::set('error', $text); else Popup::set('negative', $text);
26
+			if (!$popup) {
27
+				Messages::set('error', $text);
28
+			} else {
29
+				Popup::set('negative', $text);
30
+			}
27 31
 
28 32
 			# ------------------------
29 33
 
@@ -41,17 +45,25 @@  discard block
 block discarded – undo
41 45
 
42 46
 		public function handle(callable $callback, bool $popup = false) : bool {
43 47
 
44
-			if (false === ($post = $this->post())) return false;
48
+			if (false === ($post = $this->post())) {
49
+				return false;
50
+			}
45 51
 
46 52
 			# Check form for errors
47 53
 
48
-			if ($this->hasErrors()) return $this->displayError('FORM_ERROR_REQUIRED', $popup);
54
+			if ($this->hasErrors()) {
55
+				return $this->displayError('FORM_ERROR_REQUIRED', $popup);
56
+			}
49 57
 
50 58
 			# Call controller method and display error
51 59
 
52
-			if (is_string($result = $callback($post))) return $this->displayError($result, $popup);
60
+			if (is_string($result = $callback($post))) {
61
+				return $this->displayError($result, $popup);
62
+			}
53 63
 
54
-			if (is_array($result)) return (($this->getField($result[0])->error = true) && $this->displayError($result[1], $popup));
64
+			if (is_array($result)) {
65
+				return (($this->getField($result[0])->error = true) && $this->displayError($result[1], $popup));
66
+			}
55 67
 
56 68
 			# ------------------------
57 69
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/View.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
 			if (false === ($path = Extend\Templates::get('path'))) throw new Exception\View;
34 34
 
35
-			if (!isset(self::$cache[$file_name = ($path . $name . '.ctp')])) {
35
+			if (!isset(self::$cache[$file_name = ($path.$name.'.ctp')])) {
36 36
 
37 37
 				if (false === ($contents = Explorer::getContents($file_name))) throw new Exception\ViewFile($file_name);
38 38
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,11 +30,15 @@
 block discarded – undo
30 30
 
31 31
 		public static function get(string $name) : Template\Block {
32 32
 
33
-			if (false === ($path = Extend\Templates::get('path'))) throw new Exception\View;
33
+			if (false === ($path = Extend\Templates::get('path'))) {
34
+				throw new Exception\View;
35
+			}
34 36
 
35 37
 			if (!isset(self::$cache[$file_name = ($path . $name . '.ctp')])) {
36 38
 
37
-				if (false === ($contents = Explorer::getContents($file_name))) throw new Exception\ViewFile($file_name);
39
+				if (false === ($contents = Explorer::getContents($file_name))) {
40
+					throw new Exception\ViewFile($file_name);
41
+				}
38 42
 
39 43
 				self::$cache[$file_name] = Template::createBlock($contents);
40 44
 			}
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/SEO.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
 			if (null === self::$dataset) self::init();
62 62
 
63
-			return ((self::get('robots_index') ? 'INDEX' : 'NOINDEX') . ',' . (self::get('robots_follow') ? 'FOLLOW' : 'NOFOLLOW'));
63
+			return ((self::get('robots_index') ? 'INDEX' : 'NOINDEX').','.(self::get('robots_follow') ? 'FOLLOW' : 'NOFOLLOW'));
64 64
 		}
65 65
 	}
66 66
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,9 @@  discard block
 block discarded – undo
34 34
 
35 35
 		public static function set(string $name, $value) : bool {
36 36
 
37
-			if (null === self::$dataset) self::init();
37
+			if (null === self::$dataset) {
38
+				self::init();
39
+			}
38 40
 
39 41
 			return (self::$dataset->set($name, $value) ?? false);
40 42
 		}
@@ -47,7 +49,9 @@  discard block
 block discarded – undo
47 49
 
48 50
 		public static function get(string $name) {
49 51
 
50
-			if (null === self::$dataset) self::init();
52
+			if (null === self::$dataset) {
53
+				self::init();
54
+			}
51 55
 
52 56
 			return (self::$dataset->get($name) ?? false);
53 57
 		}
@@ -58,7 +62,9 @@  discard block
 block discarded – undo
58 62
 
59 63
 		public static function getRobots() {
60 64
 
61
-			if (null === self::$dataset) self::init();
65
+			if (null === self::$dataset) {
66
+				self::init();
67
+			}
62 68
 
63 69
 			return ((self::get('robots_index') ? 'INDEX' : 'NOINDEX') . ',' . (self::get('robots_follow') ? 'FOLLOW' : 'NOFOLLOW'));
64 70
 		}
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Messages.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,9 @@  discard block
 block discarded – undo
34 34
 
35 35
 		public static function set(string $type, string $text, string $title = null) {
36 36
 
37
-			if (!in_array($type, static::$types, true) || isset(static::$items[$type]) || ('' === $text)) return;
37
+			if (!in_array($type, static::$types, true) || isset(static::$items[$type]) || ('' === $text)) {
38
+				return;
39
+			}
38 40
 
39 41
 			static::$items[$type] = ['text' => $text, 'title' => (('' !== $title) ? $title : null)];
40 42
 		}
@@ -64,7 +66,9 @@  discard block
 block discarded – undo
64 66
 
65 67
 				$message->type = $type; $message->text = Template::createBlock($item['text']);
66 68
 
67
-				if (isset($item['title'])) $message->getBlock('title')->set('text', $item['title'])->enable();
69
+				if (isset($item['title'])) {
70
+					$message->getBlock('title')->set('text', $item['title'])->enable();
71
+				}
68 72
 			}
69 73
 
70 74
 			# ------------------------
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Page.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,11 +68,11 @@
 block discarded – undo
68 68
 
69 69
 			if ($this->page->id !== 1) SEO::set('title', $this->page->title); else $this->_layout = 'Index';
70 70
 
71
-			SEO::set('description',         $this->page->description);
72
-			SEO::set('keywords',            $this->page->keywords);
73
-			SEO::set('robots_index',        $this->page->robots_index);
74
-			SEO::set('robots_follow',       $this->page->robots_follow);
75
-			SEO::set('canonical',           $this->page->canonical);
71
+			SEO::set('description', $this->page->description);
72
+			SEO::set('keywords', $this->page->keywords);
73
+			SEO::set('robots_index', $this->page->robots_index);
74
+			SEO::set('robots_follow', $this->page->robots_follow);
75
+			SEO::set('canonical', $this->page->canonical);
76 76
 
77 77
 			# ------------------------
78 78
 
Please login to merge, or discard this patch.
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,9 +25,11 @@  discard block
 block discarded – undo
25 25
 
26 26
 			# Set breadcrumbs
27 27
 
28
-			if (count($this->path) <= 1) $contents->getBlock('breadcrumbs')->disable();
29
-
30
-			else $contents->getBlock('breadcrumbs')->path = $this->path;
28
+			if (count($this->path) <= 1) {
29
+				$contents->getBlock('breadcrumbs')->disable();
30
+			} else {
31
+				$contents->getBlock('breadcrumbs')->path = $this->path;
32
+			}
31 33
 
32 34
 			# Set contents
33 35
 
@@ -54,19 +56,31 @@  discard block
 block discarded – undo
54 56
 
55 57
 			$slug = $this->_url->getSlug();
56 58
 
57
-			if ('' !== $slug) $this->page->initBySlug($slug); else $this->page->init(1);
59
+			if ('' !== $slug) {
60
+				$this->page->initBySlug($slug);
61
+			} else {
62
+				$this->page->init(1);
63
+			}
58 64
 
59 65
 			# Display error if not found
60 66
 
61
-			if (0 === $this->page->id) return false;
67
+			if (0 === $this->page->id) {
68
+				return false;
69
+			}
62 70
 
63 71
 			# Get path
64 72
 
65
-			if (false !== ($path = $this->page->getPath())) $this->path = $path;
73
+			if (false !== ($path = $this->page->getPath())) {
74
+				$this->path = $path;
75
+			}
66 76
 
67 77
 			# Set data
68 78
 
69
-			if ($this->page->id !== 1) SEO::set('title', $this->page->title); else $this->_layout = 'Index';
79
+			if ($this->page->id !== 1) {
80
+				SEO::set('title', $this->page->title);
81
+			} else {
82
+				$this->_layout = 'Index';
83
+			}
70 84
 
71 85
 			SEO::set('description',         $this->page->description);
72 86
 			SEO::set('keywords',            $this->page->keywords);
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Handler/Basic.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,9 @@  discard block
 block discarded – undo
45 45
 
46 46
 				$name = Request::post('name');
47 47
 
48
-				if (!$this->loader->activate($name, true)) return $ajax->setError(Language::get(static::$error_activate));
48
+				if (!$this->loader->activate($name, true)) {
49
+					return $ajax->setError(Language::get(static::$error_activate));
50
+				}
49 51
 
50 52
 			} else if (Request::post('action') === 'list') {
51 53
 
@@ -67,7 +69,9 @@  discard block
 block discarded – undo
67 69
 
68 70
 			$this->loader = new static::$loader_class(Request::get('list'));
69 71
 
70
-			if ($ajax) return $this->handleAjax();
72
+			if ($ajax) {
73
+				return $this->handleAjax();
74
+			}
71 75
 
72 76
 			# ------------------------
73 77
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Loader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
 
42 42
 		protected function loadItem(string $name) {
43 43
 
44
-			$path = ($this->dir_name . $name . '/');
44
+			$path = ($this->dir_name.$name.'/');
45 45
 
46
-			if (null === ($data = JSON::load($path . '.Config.json'))) return null;
46
+			if (null === ($data = JSON::load($path.'.Config.json'))) return null;
47 47
 
48 48
 			if (null === ($data = Schema::get(static::$schema_prototype)->validate($data))) return null;
49 49
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 			foreach (Explorer::iterateDirs($this->dir_name) as $name) {
27 27
 
28
-				if (null !== ($data = $this->loadItem($name))) $items[$name] = ($pattern + $data);
28
+				if (null !== ($data = $this->loadItem($name))) {
29
+					$items[$name] = ($pattern + $data);
30
+				}
29 31
 			}
30 32
 
31 33
 			# ------------------------
@@ -43,11 +45,17 @@  discard block
 block discarded – undo
43 45
 
44 46
 			$path = ($this->dir_name . $name . '/');
45 47
 
46
-			if (null === ($data = JSON::load($path . '.Config.json'))) return null;
48
+			if (null === ($data = JSON::load($path . '.Config.json'))) {
49
+				return null;
50
+			}
47 51
 
48
-			if (null === ($data = Schema::get(static::$schema_prototype)->validate($data))) return null;
52
+			if (null === ($data = Schema::get(static::$schema_prototype)->validate($data))) {
53
+				return null;
54
+			}
49 55
 
50
-			if (!(static::$extension_class::isValid($data['name']) && ($data['name'] === $name))) return null;
56
+			if (!(static::$extension_class::isValid($data['name']) && ($data['name'] === $name))) {
57
+				return null;
58
+			}
51 59
 
52 60
 			# ------------------------
53 61
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Extension.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
23 23
 		}
24 24
 
25 25
 		/**
26
- 		 * Validate an item name
27
- 		 *
28
- 		 * @return string|false : the name or false on failure
29
- 		 */
26
+		 * Validate an item name
27
+		 *
28
+		 * @return string|false : the name or false on failure
29
+		 */
30 30
 
31 31
 		public static function validate(string $name) {
32 32
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 
42 42
 			if (null !== static::$loader) return static::$loader->$name(...$arguments);
43 43
 
44
-			throw new \BadMethodCallException('Call to undefined method ' . get_called_class() . '::' . $name . '()');
44
+			throw new \BadMethodCallException('Call to undefined method '.get_called_class().'::'.$name.'()');
45 45
 		}
46 46
 	}
47 47
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@
 block discarded – undo
39 39
 
40 40
 		public static function __callStatic($name, $arguments) {
41 41
 
42
-			if (null !== static::$loader) return static::$loader->$name(...$arguments);
42
+			if (null !== static::$loader) {
43
+				return static::$loader->$name(...$arguments);
44
+			}
43 45
 
44 46
 			throw new \BadMethodCallException('Call to undefined method ' . get_called_class() . '::' . $name . '()');
45 47
 		}
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Loader/Addons.php 1 patch
Braces   +19 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@  discard block
 block discarded – undo
23 23
 
24 24
 			foreach ((Schema::get(static::$schema)->load() ?? []) as $item) {
25 25
 
26
-				if (isset($items[$item['name']])) $items[$item['name']]['installed'] = true;
26
+				if (isset($items[$item['name']])) {
27
+					$items[$item['name']]['installed'] = true;
28
+				}
27 29
 			}
28 30
 
29 31
 			# ------------------------
@@ -41,7 +43,9 @@  discard block
 block discarded – undo
41 43
 
42 44
 			foreach ((Schema::get(static::$schema)->load() ?? []) as $item) {
43 45
 
44
-				if (static::$extension_class::isValid($item['name'])) $items[$item['name']] = $item;
46
+				if (static::$extension_class::isValid($item['name'])) {
47
+					$items[$item['name']] = $item;
48
+				}
45 49
 			}
46 50
 
47 51
 			# ------------------------
@@ -70,18 +74,26 @@  discard block
 block discarded – undo
70 74
 
71 75
 		public function install(string $name, bool $value = true) : bool {
72 76
 
73
-			if (!isset($this->items[$name])) return false;
77
+			if (!isset($this->items[$name])) {
78
+				return false;
79
+			}
74 80
 
75 81
 			$items = [];
76 82
 
77 83
 			foreach ($this->items as $item) {
78 84
 
79
-				if ($value) { if ($item['installed'] || ($item['name'] === $name)) $items[] = $item; }
80
-
81
-				else { if ($item['installed'] && ($item['name'] !== $name)) $items[] = $item; }
85
+				if ($value) { if ($item['installed'] || ($item['name'] === $name)) {
86
+					$items[] = $item;
87
+				}
88
+				} else { if ($item['installed'] && ($item['name'] !== $name)) {
89
+					$items[] = $item;
90
+				}
91
+				}
82 92
 			}
83 93
 
84
-			if (!Schema::get(static::$schema)->save($items)) return false;
94
+			if (!Schema::get(static::$schema)->save($items)) {
95
+				return false;
96
+			}
85 97
 
86 98
 			$this->items[$name]['installed'] = $value;
87 99
 
Please login to merge, or discard this patch.