@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function toMap($objArray = null): ?array |
55 | 55 | { |
56 | - $data = $objArray??$this; |
|
56 | + $data = $objArray ?? $this; |
|
57 | 57 | if (is_array($data) || is_object($data)) |
58 | 58 | { |
59 | 59 | $result = []; |
@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | $re_2 = new ReflectionObject($data); |
84 | 84 | $classname = get_class($this); |
85 | 85 | if ($pos = strrpos($classname, '\\')) $classname = substr($classname, $pos + 1); |
86 | - return $classname .' {' . implode(', ', array_map( |
|
86 | + return $classname . ' {' . implode(', ', array_map( |
|
87 | 87 | function($p_0) use ($data) |
88 | 88 | { |
89 | 89 | $p_0->setAccessible(true); |
90 | - return $p_0->getName() .': '. $p_0->getValue($data); |
|
91 | - }, $re_2->getProperties())) .'}'; |
|
90 | + return $p_0->getName() . ': ' . $p_0->getValue($data); |
|
91 | + }, $re_2->getProperties())) . '}'; |
|
92 | 92 | |
93 | 93 | } |
94 | 94 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function __get($attribute):string |
100 | 100 | { |
101 | - return $this->{$attribute}??""; |
|
101 | + return $this->{$attribute} ?? ""; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -51,8 +51,9 @@ discard block |
||
51 | 51 | $sql = "INSERT INTO {$this->tableName} ({$fields}) VALUES ({$numparams})"; |
52 | 52 | if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; return; } |
53 | 53 | $result = $this->executeSQL($sql, $values); |
54 | - if (empty($result)) |
|
55 | - return false; |
|
54 | + if (empty($result)) { |
|
55 | + return false; |
|
56 | + } |
|
56 | 57 | return true; |
57 | 58 | } |
58 | 59 | |
@@ -84,8 +85,9 @@ discard block |
||
84 | 85 | $query = "INSERT INTO $this->tableName"; |
85 | 86 | $values = []; |
86 | 87 | $dataColumns = array_keys($params); |
87 | - if (isset ($dataColumns[0])) |
|
88 | - $query .= ' (`' . implode('`, `', $dataColumns) . '`) '; |
|
88 | + if (isset ($dataColumns[0])) { |
|
89 | + $query .= ' (`' . implode('`, `', $dataColumns) . '`) '; |
|
90 | + } |
|
89 | 91 | $query .= ' VALUES ('; |
90 | 92 | |
91 | 93 | foreach ($dataColumns as $index => $column) { |
@@ -97,8 +99,9 @@ discard block |
||
97 | 99 | $query .= ')'; |
98 | 100 | |
99 | 101 | $result = $this->executeSQL($query, $values); |
100 | - if (empty($result)) |
|
101 | - return false; |
|
102 | + if (empty($result)) { |
|
103 | + return false; |
|
104 | + } |
|
102 | 105 | return true; |
103 | 106 | } else { |
104 | 107 | return false; |
@@ -123,8 +126,9 @@ discard block |
||
123 | 126 | if (isset($where)) { $sql .= " WHERE $where"; } |
124 | 127 | if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; return; } |
125 | 128 | $result = $this->executeSQL($sql, $values); |
126 | - if (empty($result)) |
|
127 | - return false; |
|
129 | + if (empty($result)) { |
|
130 | + return false; |
|
131 | + } |
|
128 | 132 | return true; |
129 | 133 | } |
130 | 134 | |
@@ -165,12 +169,14 @@ discard block |
||
165 | 169 | } |
166 | 170 | $query = rtrim($query, ", "); |
167 | 171 | |
168 | - if (!empty($where)) |
|
169 | - $query .= " WHERE {$where}"; |
|
172 | + if (!empty($where)) { |
|
173 | + $query .= " WHERE {$where}"; |
|
174 | + } |
|
170 | 175 | |
171 | 176 | $result = $this->executeSQL($query, $values); |
172 | - if (empty($result)) |
|
173 | - return false; |
|
177 | + if (empty($result)) { |
|
178 | + return false; |
|
179 | + } |
|
174 | 180 | return true; |
175 | 181 | } else { |
176 | 182 | return false; |
@@ -190,8 +196,9 @@ discard block |
||
190 | 196 | if (!empty($where)) { $sql .= " WHERE $where"; } |
191 | 197 | if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; return; } |
192 | 198 | $result = $this->executeSQL($sql, $values); |
193 | - if (empty($result)) |
|
194 | - return false; |
|
199 | + if (empty($result)) { |
|
200 | + return false; |
|
201 | + } |
|
195 | 202 | return true; |
196 | 203 | } |
197 | 204 |