@@ -12,13 +12,17 @@ discard block |
||
12 | 12 | |
13 | 13 | public function init($value, string $name = 'id') { |
14 | 14 | |
15 | - if (0 !== $this->id) return false; |
|
15 | + if (0 !== $this->id) { |
|
16 | + return false; |
|
17 | + } |
|
16 | 18 | |
17 | 19 | # Check param name |
18 | 20 | |
19 | - if ($name === 'id') $param = $this->definition->id(); |
|
20 | - |
|
21 | - else if ((false === ($param = $this->definition->get($name))) || !$param->unique()) return false; |
|
21 | + if ($name === 'id') { |
|
22 | + $param = $this->definition->id(); |
|
23 | + } else if ((false === ($param = $this->definition->get($name))) || !$param->unique()) { |
|
24 | + return false; |
|
25 | + } |
|
22 | 26 | |
23 | 27 | # Select entity from DB |
24 | 28 | |
@@ -28,7 +32,9 @@ discard block |
||
28 | 32 | |
29 | 33 | DB::select(static::$table, $selection, [$name => $value], null, 1); |
30 | 34 | |
31 | - if (($this->error = !(DB::last() && DB::last()->status)) || (DB::last()->rows !== 1)) return false; |
|
35 | + if (($this->error = !(DB::last() && DB::last()->status)) || (DB::last()->rows !== 1)) { |
|
36 | + return false; |
|
37 | + } |
|
32 | 38 | |
33 | 39 | $data = DB::last()->row(); |
34 | 40 | |
@@ -40,7 +46,9 @@ discard block |
||
40 | 46 | |
41 | 47 | # Init path |
42 | 48 | |
43 | - if (static::$nesting) $this->data['path'] = $this->getPath(); |
|
49 | + if (static::$nesting) { |
|
50 | + $this->data['path'] = $this->getPath(); |
|
51 | + } |
|
44 | 52 | |
45 | 53 | # Implement entity |
46 | 54 |