Passed
Push — 0.3.0 ( 0d73f1...9a02d7 )
by Anton
04:10
created
www/engine/System/Classes/Handlers/Tools/Sitemap.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
 			$selection = 'MAX(time_modified) as last_modified';
14 14
 
15
-			if (!(DB::select(TABLE_PAGES, $selection) && (DB::last()->rows === 1))) return 0;
15
+			if (!(DB::select(TABLE_PAGES, $selection) && (DB::last()->rows === 1))) {
16
+				return 0;
17
+			}
16 18
 
17 19
 			# ------------------------
18 20
 
@@ -27,11 +29,15 @@  discard block
 block discarded – undo
27 29
 
28 30
 			$condition = ['visibility' => VISIBILITY_PUBLISHED, 'access' => ACCESS_PUBLIC, 'locked' => 0];
29 31
 
30
-			if (!(DB::select(TABLE_PAGES, $selection, $condition, 'slug') && DB::last()->status)) return;
32
+			if (!(DB::select(TABLE_PAGES, $selection, $condition, 'slug') && DB::last()->status)) {
33
+				return;
34
+			}
31 35
 
32 36
 			# ------------------------
33 37
 
34
-			while (null !== ($page = DB::last()->row())) yield Entitizer::dataset(TABLE_PAGES, $page);
38
+			while (null !== ($page = DB::last()->row())) {
39
+				yield Entitizer::dataset(TABLE_PAGES, $page);
40
+			}
35 41
 		}
36 42
 
37 43
 		# Handle request
@@ -44,7 +50,9 @@  discard block
 block discarded – undo
44 50
 
45 51
 			# Get last modification time
46 52
 
47
-			if ($sitemap->load($this->getLastModified())) return $sitemap;
53
+			if ($sitemap->load($this->getLastModified())) {
54
+				return $sitemap;
55
+			}
48 56
 
49 57
 			# Fill sitemap
50 58
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Dataset/Page.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,14 +19,18 @@
 block discarded – undo
19 19
 
20 20
 			$this->addHandler('link', function (array $data) {
21 21
 
22
-				if ('' === $data['slug']) return '';
22
+				if ('' === $data['slug']) {
23
+					return '';
24
+				}
23 25
 
24 26
 				return (INSTALL_PATH . '/' . $data['slug']);
25 27
 			});
26 28
 
27 29
 			$this->addHandler('canonical', function (array $data) {
28 30
 
29
-				if ('' === $data['slug']) return '';
31
+				if ('' === $data['slug']) {
32
+					return '';
33
+				}
30 34
 
31 35
 				return (Settings::get('system_url') . (($data['id'] !== 1) ? ('/' . $data['slug']) : ''));
32 36
 			});
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Dataset/Menuitem.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,13 @@
 block discarded – undo
14 14
 
15 15
 			$this->addHandler('link', function (array $data) {
16 16
 
17
-				if ('' === $data['slug']) return '';
17
+				if ('' === $data['slug']) {
18
+					return '';
19
+				}
18 20
 
19
-				if (false !== Validate::url($data['slug'])) return $data['slug'];
21
+				if (false !== Validate::url($data['slug'])) {
22
+					return $data['slug'];
23
+				}
20 24
 
21 25
 				return (INSTALL_PATH . '/' . $data['slug']);
22 26
 			});
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Definition.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@
 block discarded – undo
16 16
 
17 17
 			foreach ([$this->params, $this->indexes, $this->foreigns] as $group) {
18 18
 
19
-				foreach ($group->list() as $item) $statements[] = $item->statement();
19
+				foreach ($group->list() as $item) {
20
+					$statements[] = $item->statement();
21
+				}
20 22
 			}
21 23
 
22 24
 			# ------------------------
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Lister.php 1 patch
Braces   +39 added lines, -17 removed lines patch added patch discarded remove patch
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 			# Set create button
22 22
 
23
-			if (count($this->path) < CONFIG_ENTITIZER_MAX_DEPTH) $parent->block('create')->id = $this->parent->id;
24
-
25
-			else { $parent->block('create')->disable(); $parent->block('create_disabled')->enable(); }
23
+			if (count($this->path) < CONFIG_ENTITIZER_MAX_DEPTH) {
24
+				$parent->block('create')->id = $this->parent->id;
25
+			} else { $parent->block('create')->disable(); $parent->block('create_disabled')->enable(); }
26 26
 
27 27
 			# Set edit button
28 28
 
29
-			if (0 !== $this->parent->id) $parent->block('edit')->id = $this->parent->id;
30
-
31
-			else { $parent->block('edit')->disable(); $parent->block('edit_disabled')->enable(); }
29
+			if (0 !== $this->parent->id) {
30
+				$parent->block('edit')->id = $this->parent->id;
31
+			} else { $parent->block('edit')->disable(); $parent->block('edit_disabled')->enable(); }
32 32
 
33 33
 			# Add parent additional data
34 34
 
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
 
44 44
 			foreach ($this->items['list'] as $item) {
45 45
 
46
-				if ((null !== $this->entity) && ($item['dataset']->id === $this->entity->id)) continue;
46
+				if ((null !== $this->entity) && ($item['dataset']->id === $this->entity->id)) {
47
+					continue;
48
+				}
47 49
 
48 50
 				$items->add($view = View::get(!$ajax ? static::$view_item : static::$view_ajax_item));
49 51
 
@@ -101,21 +103,29 @@  discard block
 block discarded – undo
101 103
 
102 104
 			# Set path
103 105
 
104
-			if (static::$nesting) $contents->path = $this->path;
106
+			if (static::$nesting) {
107
+				$contents->path = $this->path;
108
+			}
105 109
 
106 110
 			# Process parent block
107 111
 
108
-			if (static::$nesting && !$ajax) $this->processParent($contents->block('parent'));
112
+			if (static::$nesting && !$ajax) {
113
+				$this->processParent($contents->block('parent'));
114
+			}
109 115
 
110 116
 			# Set items
111 117
 
112 118
 			$items = $this->getItemsBlock($ajax);
113 119
 
114
-			if ($items->count() > 0) $contents->items = $items;
120
+			if ($items->count() > 0) {
121
+				$contents->items = $items;
122
+			}
115 123
 
116 124
 			# Set pagination
117 125
 
118
-			if (!$ajax) $contents->pagination = $this->getPaginationBlock();
126
+			if (!$ajax) {
127
+				$contents->pagination = $this->getPaginationBlock();
128
+			}
119 129
 
120 130
 			# ------------------------
121 131
 
@@ -140,15 +150,21 @@  discard block
 block discarded – undo
140 150
 
141 151
 			# Get path and depth
142 152
 
143
-			if (false !== ($path = $this->parent->path())) $this->path = $path;
153
+			if (false !== ($path = $this->parent->path())) {
154
+				$this->path = $path;
155
+			}
144 156
 
145
-			if ((0 !== $this->entity->id) && (false !== ($depth = $this->entity->subtreeDepth()))) $this->depth = $depth;
157
+			if ((0 !== $this->entity->id) && (false !== ($depth = $this->entity->subtreeDepth()))) {
158
+				$this->depth = $depth;
159
+			}
146 160
 
147 161
 			# Get items list
148 162
 
149 163
 			$lister = (static::$nesting ? 'children' : 'items');
150 164
 
151
-			if (false !== ($items = $this->parent->$lister())) $this->items = $items;
165
+			if (false !== ($items = $this->parent->$lister())) {
166
+				$this->items = $items;
167
+			}
152 168
 
153 169
 			# ------------------------
154 170
 
@@ -159,7 +175,9 @@  discard block
 block discarded – undo
159 175
 
160 176
 		public function handle() {
161 177
 
162
-			if (Request::isAjax()) return $this->handleAjax();
178
+			if (Request::isAjax()) {
179
+				return $this->handleAjax();
180
+			}
163 181
 
164 182
 			$this->index = Number::format(Request::get('index'), 1, 999999);
165 183
 
@@ -171,13 +189,17 @@  discard block
 block discarded – undo
171 189
 
172 190
 			# Get path
173 191
 
174
-			if (false !== ($path = $this->parent->path())) $this->path = $path;
192
+			if (false !== ($path = $this->parent->path())) {
193
+				$this->path = $path;
194
+			}
175 195
 
176 196
 			# Get items list
177 197
 
178 198
 			$lister = (static::$nesting ? 'children' : 'items'); $index = $this->index; $display = static::$display;
179 199
 
180
-			if (false !== ($items = $this->parent->$lister([], [], $index, $display))) $this->items = $items;
200
+			if (false !== ($items = $this->parent->$lister([], [], $index, $display))) {
201
+				$this->items = $items;
202
+			}
181 203
 
182 204
 			# ------------------------
183 205
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Dataset.php 1 patch
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
 		protected function addHandler(string $name, callable $handler) {
14 14
 
15
-			if ((false !== $this->definition->param($name)) || isset($this->handlers[$name])) return;
15
+			if ((false !== $this->definition->param($name)) || isset($this->handlers[$name])) {
16
+				return;
17
+			}
16 18
 
17 19
 			$this->handlers[$name] = $handler;
18 20
 		}
@@ -32,15 +34,21 @@  discard block
 block discarded – undo
32 34
 
33 35
 			# Reset params
34 36
 
35
-			foreach ($this->definition->params() as $name => $param) $this->data[$name] = $param->cast(null);
37
+			foreach ($this->definition->params() as $name => $param) {
38
+				$this->data[$name] = $param->cast(null);
39
+			}
36 40
 
37 41
 			# Reset extras
38 42
 
39
-			foreach ($this->handlers as $name => $handler) $this->data[$name] = $handler($this->data);
43
+			foreach ($this->handlers as $name => $handler) {
44
+				$this->data[$name] = $handler($this->data);
45
+			}
40 46
 
41 47
 			# Reset parent id
42 48
 
43
-			if (static::$nesting) $this->data['parent_id'] = 0;
49
+			if (static::$nesting) {
50
+				$this->data['parent_id'] = 0;
51
+			}
44 52
 
45 53
 			# ------------------------
46 54
 
@@ -55,14 +63,18 @@  discard block
 block discarded – undo
55 63
 
56 64
 			foreach ($data as $name => $value) {
57 65
 
58
-				if (false === ($param = $this->definition->param($name))) continue;
66
+				if (false === ($param = $this->definition->param($name))) {
67
+					continue;
68
+				}
59 69
 
60 70
 				$this->data[$name] = $param->cast($value);
61 71
 			}
62 72
 
63 73
 			# Update extras
64 74
 
65
-			foreach ($this->handlers as $name => $handler) $this->data[$name] = $handler($this->data);
75
+			foreach ($this->handlers as $name => $handler) {
76
+				$this->data[$name] = $handler($this->data);
77
+			}
66 78
 
67 79
 			# Update parent id
68 80
 
@@ -84,7 +96,9 @@  discard block
 block discarded – undo
84 96
 
85 97
 			foreach ($data as $name => $value) {
86 98
 
87
-				if (false === ($param = $this->definition->param($name))) continue;
99
+				if (false === ($param = $this->definition->param($name))) {
100
+					continue;
101
+				}
88 102
 
89 103
 				$cast[$name] = $param->cast($value);
90 104
 			}
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Listview.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -68,9 +68,13 @@  discard block
 block discarded – undo
68 68
 
69 69
 		private function select(int $parent_id = null, array $config = [], array $order_by = [], int $index = 0, int $display = 0) {
70 70
 
71
-			if (!((null === $parent_id) || ($parent_id >= 0))) return false;
71
+			if (!((null === $parent_id) || ($parent_id >= 0))) {
72
+				return false;
73
+			}
72 74
 
73
-			if (!(($index >= 0) && ($display >= 0))) return false;
75
+			if (!(($index >= 0) && ($display >= 0))) {
76
+				return false;
77
+			}
74 78
 
75 79
 			# Select entities
76 80
 
@@ -78,7 +82,9 @@  discard block
 block discarded – undo
78 82
 
79 83
 				$this->getNestingSelectQuery($parent_id, $config, $order_by, $index, $display));
80 84
 
81
-			if (!(DB::send($query) && DB::last()->status)) return false;
85
+			if (!(DB::send($query) && DB::last()->status)) {
86
+				return false;
87
+			}
82 88
 
83 89
 			# Process results
84 90
 
@@ -90,7 +96,9 @@  discard block
 block discarded – undo
90 96
 
91 97
 				$items['list'][$dataset->id]['dataset'] = $dataset;
92 98
 
93
-				if (null !== $parent_id) $items['list'][$dataset->id]['children'] = intval($data['children']);
99
+				if (null !== $parent_id) {
100
+					$items['list'][$dataset->id]['children'] = intval($data['children']);
101
+				}
94 102
 			}
95 103
 
96 104
 			# Count total
@@ -109,7 +117,9 @@  discard block
 block discarded – undo
109 117
 
110 118
 		private function count(int $parent_id = null, array $config = []) {
111 119
 
112
-			if (!((null === $parent_id) || ($parent_id >= 0))) return false;
120
+			if (!((null === $parent_id) || ($parent_id >= 0))) {
121
+				return false;
122
+			}
113 123
 
114 124
 			# Count entities
115 125
 
@@ -117,7 +127,9 @@  discard block
 block discarded – undo
117 127
 
118 128
 				$this->getNestingCountQuery($parent_id, $config));
119 129
 
120
-			if (!(DB::send($query) && DB::last()->status)) return false;
130
+			if (!(DB::send($query) && DB::last()->status)) {
131
+				return false;
132
+			}
121 133
 
122 134
 			# ------------------------
123 135
 
@@ -142,7 +154,9 @@  discard block
 block discarded – undo
142 154
 
143 155
 		public function children(int $parent_id = 0, array $config = [], array $order_by = [], int $index = 0, int $display = 0) {
144 156
 
145
-			if (!static::$nesting) return false;
157
+			if (!static::$nesting) {
158
+				return false;
159
+			}
146 160
 
147 161
 			return $this->select($parent_id, $config, $order_by, $index, $display);
148 162
 		}
@@ -151,7 +165,9 @@  discard block
 block discarded – undo
151 165
 
152 166
 		public function childrenCount(int $parent_id = 0, array $config = []) {
153 167
 
154
-			if (!static::$nesting) return false;
168
+			if (!static::$nesting) {
169
+				return false;
170
+			}
155 171
 
156 172
 			return $this->count($parent_id, $config);
157 173
 		}
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Treeview.php 1 patch
Braces   +27 added lines, -9 removed lines patch added patch discarded remove patch
@@ -58,13 +58,17 @@  discard block
 block discarded – undo
58 58
 
59 59
 		public function subtree(int $parent_id = 0, array $config = [], array $order_by = []) {
60 60
 
61
-			if (!(static::$nesting && ($parent_id >= 0))) return false;
61
+			if (!(static::$nesting && ($parent_id >= 0))) {
62
+				return false;
63
+			}
62 64
 
63 65
 			# Select entities
64 66
 
65 67
 			$query = $this->getSelectQuery($parent_id, $config, $order_by);
66 68
 
67
-			if (!(DB::send($query) && DB::last()->status)) return false;
69
+			if (!(DB::send($query) && DB::last()->status)) {
70
+				return false;
71
+			}
68 72
 
69 73
 			# Process results
70 74
 
@@ -88,13 +92,17 @@  discard block
 block discarded – undo
88 92
 
89 93
 		public function subtreeCount(int $parent_id = 0) {
90 94
 
91
-			if (!(static::$nesting && ($parent_id >= 0))) return false;
95
+			if (!(static::$nesting && ($parent_id >= 0))) {
96
+				return false;
97
+			}
92 98
 
93 99
 			# Get count
94 100
 
95 101
 			$query = $this->getCountQuery($parent_id);
96 102
 
97
-			if (!(DB::send($query) && DB::last()->status)) return false;
103
+			if (!(DB::send($query) && DB::last()->status)) {
104
+				return false;
105
+			}
98 106
 
99 107
 			# ------------------------
100 108
 
@@ -105,13 +113,17 @@  discard block
 block discarded – undo
105 113
 
106 114
 		public function subtreeDepth(int $parent_id = 0) {
107 115
 
108
-			if (!(static::$nesting && ($parent_id >= 0))) return false;
116
+			if (!(static::$nesting && ($parent_id >= 0))) {
117
+				return false;
118
+			}
109 119
 
110 120
 			# Get depth
111 121
 
112 122
 			$query = $this->getDepthQuery($parent_id);
113 123
 
114
-			if (!(DB::send($query) && DB::last()->status)) return false;
124
+			if (!(DB::send($query) && DB::last()->status)) {
125
+				return false;
126
+			}
115 127
 
116 128
 			# ------------------------
117 129
 
@@ -122,7 +134,9 @@  discard block
 block discarded – undo
122 134
 
123 135
 		public function path(int $parent_id = 0) {
124 136
 
125
-			if (!(static::$nesting && ($parent_id >= 0))) return false;
137
+			if (!(static::$nesting && ($parent_id >= 0))) {
138
+				return false;
139
+			}
126 140
 
127 141
 			# Process query
128 142
 
@@ -134,13 +148,17 @@  discard block
 block discarded – undo
134 148
 
135 149
 			# Select path
136 150
 
137
-			if (!(DB::send($query) && DB::last()->status)) return false;
151
+			if (!(DB::send($query) && DB::last()->status)) {
152
+				return false;
153
+			}
138 154
 
139 155
 			# Process results
140 156
 
141 157
 			$path = [];
142 158
 
143
-			while (null !== ($data = DB::last()->row())) $path[] = Entitizer::dataset(static::$table, $data)->data();
159
+			while (null !== ($data = DB::last()->row())) {
160
+				$path[] = Entitizer::dataset(static::$table, $data)->data();
161
+			}
144 162
 
145 163
 			# ------------------------
146 164
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Entity/Modify.php 1 patch
Braces   +66 added lines, -22 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@  discard block
 block discarded – undo
35 35
 
36 36
 			         ("WHERE rlb.ancestor = " . $this->id . " AND rlx.ancestor IS NULL");
37 37
 
38
-			if (!(DB::send($query) && DB::last()->status)) return false;
38
+			if (!(DB::send($query) && DB::last()->status)) {
39
+				return false;
40
+			}
39 41
 
40 42
 			# Set path
41 43
 
@@ -60,7 +62,9 @@  discard block
 block discarded – undo
60 62
 
61 63
 			         ("WHERE sub.ancestor = " . $this->id . " AND sup.descendant = " . $parent_id);
62 64
 
63
-			if (!(DB::send($query) && (DB::last()->rows > 0))) return false;
65
+			if (!(DB::send($query) && (DB::last()->rows > 0))) {
66
+				return false;
67
+			}
64 68
 
65 69
 			# Set path
66 70
 
@@ -75,27 +79,37 @@  discard block
 block discarded – undo
75 79
 
76 80
 		public function create(array $data) {
77 81
 
78
-			if (0 !== $this->id) return false;
82
+			if (0 !== $this->id) {
83
+				return false;
84
+			}
79 85
 
80 86
 			$data = $this->dataset->cast($data);
81 87
 
82
-			if (static::$auto_increment && isset($data['id'])) $data['id'] = 0;
88
+			if (static::$auto_increment && isset($data['id'])) {
89
+				$data['id'] = 0;
90
+			}
83 91
 
84 92
 			# Insert entity
85 93
 
86 94
 			DB::insert(static::$table, $data);
87 95
 
88
-			if (!(DB::last() && DB::last()->status)) return false;
96
+			if (!(DB::last() && DB::last()->status)) {
97
+				return false;
98
+			}
89 99
 
90 100
 			# Update data
91 101
 
92
-			if (static::$auto_increment) $data['id'] = DB::last()->id;
102
+			if (static::$auto_increment) {
103
+				$data['id'] = DB::last()->id;
104
+			}
93 105
 
94 106
 			$this->dataset->update($data);
95 107
 
96 108
 			# Init subtreee
97 109
 
98
-			if (static::$nesting) $this->initSubtree();
110
+			if (static::$nesting) {
111
+				$this->initSubtree();
112
+			}
99 113
 
100 114
 			# Cache entity
101 115
 
@@ -110,17 +124,23 @@  discard block
 block discarded – undo
110 124
 
111 125
 		public function edit(array $data) {
112 126
 
113
-			if (0 === $this->id) return false;
127
+			if (0 === $this->id) {
128
+				return false;
129
+			}
114 130
 
115 131
 			$data = $this->dataset->cast($data);
116 132
 
117
-			if (isset($data['id'])) unset($data['id']);
133
+			if (isset($data['id'])) {
134
+				unset($data['id']);
135
+			}
118 136
 
119 137
 			# Update entity
120 138
 
121 139
 			DB::update(static::$table, $data, ['id' => $this->id]);
122 140
 
123
-			if (!(DB::last() && DB::last()->status)) return false;
141
+			if (!(DB::last() && DB::last()->status)) {
142
+				return false;
143
+			}
124 144
 
125 145
 			# Update data
126 146
 
@@ -128,7 +148,9 @@  discard block
 block discarded – undo
128 148
 
129 149
 			# Init subtreee
130 150
 
131
-			if (static::$nesting) $this->initSubtree();
151
+			if (static::$nesting) {
152
+				$this->initSubtree();
153
+			}
132 154
 
133 155
 			# ------------------------
134 156
 
@@ -139,30 +161,44 @@  discard block
 block discarded – undo
139 161
 
140 162
 		public function move(int $parent_id) {
141 163
 
142
-			if (0 === $this->id) return false;
164
+			if (0 === $this->id) {
165
+				return false;
166
+			}
143 167
 
144 168
 			# Re-connect entity if not in tree
145 169
 
146
-			if (!$this->initSubtree()) return false;
170
+			if (!$this->initSubtree()) {
171
+				return false;
172
+			}
147 173
 
148 174
 			# Create parent entity
149 175
 
150 176
 			if (0 !== ($parent = Entitizer::get(static::$table, $parent_id))->id) {
151 177
 
152
-				if (false === ($path = $parent->path())) return false;
178
+				if (false === ($path = $parent->path())) {
179
+					return false;
180
+				}
153 181
 
154
-				if (false === ($depth = $this->subtreeDepth())) return false;
182
+				if (false === ($depth = $this->subtreeDepth())) {
183
+					return false;
184
+				}
155 185
 
156
-				if ((count($path) + $depth + 1) > CONFIG_ENTITIZER_MAX_DEPTH) return false;
186
+				if ((count($path) + $depth + 1) > CONFIG_ENTITIZER_MAX_DEPTH) {
187
+					return false;
188
+				}
157 189
 			}
158 190
 
159 191
 			# Disconnect subtree from current position
160 192
 
161
-			if (!$this->disconnectSubtree()) return false;
193
+			if (!$this->disconnectSubtree()) {
194
+				return false;
195
+			}
162 196
 
163 197
 			# Connect subtree under new position
164 198
 
165
-		 	if (0 !== $parent->id) $this->connectSubtree($parent->id);
199
+		 	if (0 !== $parent->id) {
200
+		 		$this->connectSubtree($parent->id);
201
+		 	}
166 202
 
167 203
 			# ------------------------
168 204
 
@@ -173,19 +209,27 @@  discard block
 block discarded – undo
173 209
 
174 210
 		public function remove() {
175 211
 
176
-			if (0 === $this->id) return false;
212
+			if (0 === $this->id) {
213
+				return false;
214
+			}
177 215
 
178 216
 			# Check if entity is removable
179 217
 
180
-			if (static::$super && ($this->id === 1)) return false;
218
+			if (static::$super && ($this->id === 1)) {
219
+				return false;
220
+			}
181 221
 
182
-			if (static::$nesting && (0 !== $this->subtreeCount())) return false;
222
+			if (static::$nesting && (0 !== $this->subtreeCount())) {
223
+				return false;
224
+			}
183 225
 
184 226
 			# Remove entity
185 227
 
186 228
 			DB::delete(static::$table, ['id' => $this->id]);
187 229
 
188
-			if (!(DB::last() && DB::last()->status)) return false;
230
+			if (!(DB::last() && DB::last()->status)) {
231
+				return false;
232
+			}
189 233
 
190 234
 			# Uncache entity
191 235
 
Please login to merge, or discard this patch.