@@ -87,7 +87,7 @@ |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | return $classname . ' {' . implode(', ', array_map( |
| 90 | - function ($p_0) use ($data) { |
|
| 90 | + function($p_0) use ($data) { |
|
| 91 | 91 | $p_0->setAccessible(true); |
| 92 | 92 | |
| 93 | 93 | return $p_0->getName() . ': ' . $p_0->getValue($data); |
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
| 165 | 165 | return $prepare->rowCount(); |
| 166 | 166 | } catch (PDOException $e) { |
| 167 | - $this->setError($e);} |
|
| 167 | + $this->setError($e); } |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
@@ -132,8 +132,9 @@ |
||
| 132 | 132 | */ |
| 133 | 133 | protected function setTable(string $tableName, string $tableAlias = ""): self |
| 134 | 134 | { |
| 135 | - if (!empty($tableAlias)) |
|
| 136 | - $this->tableAlias = $tableAlias; |
|
| 135 | + if (!empty($tableAlias)) {
|
|
| 136 | + $this->tableAlias = $tableAlias; |
|
| 137 | + } |
|
| 137 | 138 | $this->tableName = $tableName; |
| 138 | 139 | return $this; |
| 139 | 140 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function select(string $fields = '*', string $add = '', array $values = null, bool $returnModel = false, bool $debug = false) |
| 29 | 29 | {
|
| 30 | - if (strlen($add) > 0) {
|
|
| 30 | + if (strlen($add)>0) {
|
|
| 31 | 31 | $add = ' ' . $add; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $numparams = substr($numparams, 1); |
| 67 | 67 | $sql = "INSERT INTO {$this->getTable()} ({$fields}) VALUES ({$numparams})";
|
| 68 | 68 | if ($debug) {
|
| 69 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
| 69 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
| 70 | 70 | return; |
| 71 | 71 | } |
| 72 | 72 | $result = $this->executeSQL($sql, $values); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $sql .= " WHERE $where"; |
| 149 | 149 | } |
| 150 | 150 | if ($debug) {
|
| 151 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
| 151 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
| 152 | 152 | return; |
| 153 | 153 | } |
| 154 | 154 | $result = $this->executeSQL($sql, $values); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $sql .= " WHERE $where"; |
| 224 | 224 | } |
| 225 | 225 | if ($debug) {
|
| 226 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
| 226 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
| 227 | 227 | return; |
| 228 | 228 | } |
| 229 | 229 | $result = $this->executeSQL($sql, $values); |
@@ -33,8 +33,9 @@ |
||
| 33 | 33 | |
| 34 | 34 | $sql = "SELECT {$fields} FROM {$this->getTable()}";
|
| 35 | 35 | |
| 36 | - if (!empty($this->getTableAlias())) |
|
| 37 | - $sql .= " AS {$this->getTableAlias()}";
|
|
| 36 | + if (!empty($this->getTableAlias())) {
|
|
| 37 | + $sql .= " AS {$this->getTableAlias()}";
|
|
| 38 | + } |
|
| 38 | 39 | |
| 39 | 40 | $sql .= "{$add}";
|
| 40 | 41 | |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | |
| 155 | 155 | public function debug() |
| 156 | 156 | {
|
| 157 | - return $this->query.'<pre>'.print_r($this->params).'</pre>'; |
|
| 157 | + return $this->query . '<pre>' . print_r($this->params) . '</pre>'; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -25,8 +25,9 @@ discard block |
||
| 25 | 25 | public function select(string $fields = "*", array $paramns = []):self |
| 26 | 26 | {
|
| 27 | 27 | $query = "SELECT {$fields} FROM {$this->getTable()} ";
|
| 28 | - if (!empty($this->getTableAlias())) |
|
| 29 | - $query .= "AS {$this->getTableAlias()}";
|
|
| 28 | + if (!empty($this->getTableAlias())) {
|
|
| 29 | + $query .= "AS {$this->getTableAlias()}";
|
|
| 30 | + } |
|
| 30 | 31 | $this->add($query, $paramns); |
| 31 | 32 | return $this; |
| 32 | 33 | } |
@@ -175,8 +176,9 @@ discard block |
||
| 175 | 176 | |
| 176 | 177 | private function add(string $text, array $params = []) |
| 177 | 178 | {
|
| 178 | - if (!empty($params)) |
|
| 179 | - $this->params[] = $params; |
|
| 179 | + if (!empty($params)) {
|
|
| 180 | + $this->params[] = $params; |
|
| 181 | + } |
|
| 180 | 182 | $this->query .= $text; |
| 181 | 183 | } |
| 182 | 184 | |