@@ -129,7 +129,7 @@ |
||
129 | 129 | * |
130 | 130 | * @var int |
131 | 131 | */ |
132 | - public $sqlite_flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE; |
|
132 | + public $sqlite_flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE; |
|
133 | 133 | |
134 | 134 | /** |
135 | 135 | * An optional encryption key used when encrypting and decrypting an SQLite database. |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * |
44 | 44 | * @return mixed|null |
45 | 45 | */ |
46 | - public function __get(string $name) { |
|
46 | + public function __get(string $name){ |
|
47 | 47 | |
48 | 48 | if(isset($this->array[$name])){ |
49 | 49 | return $this->array[$name]; |
@@ -161,16 +161,16 @@ |
||
161 | 161 | * |
162 | 162 | * @return void |
163 | 163 | */ |
164 | - protected function bindParams(PDOStatement &$stmt, array $values){ |
|
164 | + protected function bindParams(PDOStatement&$stmt, array $values){ |
|
165 | 165 | $param_no = 1; |
166 | 166 | |
167 | 167 | foreach($values as $v){ |
168 | 168 | |
169 | 169 | switch(gettype($v)){ |
170 | 170 | case 'boolean': $type = PDO::PARAM_BOOL; break; |
171 | - case 'integer': $type = PDO::PARAM_INT; break; |
|
171 | + case 'integer': $type = PDO::PARAM_INT; break; |
|
172 | 172 | case 'NULL' : $type = PDO::PARAM_NULL; break; |
173 | - default: $type = PDO::PARAM_STR; break; |
|
173 | + default: $type = PDO::PARAM_STR; break; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | $stmt->bindValue($param_no, $v, $type); |
@@ -18,21 +18,21 @@ |
||
18 | 18 | */ |
19 | 19 | trait Magic{ |
20 | 20 | |
21 | - public function __get(string $name) { |
|
21 | + public function __get(string $name){ |
|
22 | 22 | return $this->get($name); |
23 | 23 | } |
24 | 24 | |
25 | - public function __set(string $name, $value) { |
|
25 | + public function __set(string $name, $value){ |
|
26 | 26 | $this->set($name, $value); |
27 | 27 | } |
28 | 28 | |
29 | - private function get(string $name) { |
|
29 | + private function get(string $name){ |
|
30 | 30 | $method = 'magic_get_'.$name; |
31 | 31 | |
32 | 32 | return method_exists($this, $method) ? $this->$method() : null; |
33 | 33 | } |
34 | 34 | |
35 | - private function set(string $name, $value) { |
|
35 | + private function set(string $name, $value){ |
|
36 | 36 | $method = 'magic_set_'.$name; |
37 | 37 | |
38 | 38 | if(method_exists($this, $method)){ |
@@ -22,8 +22,8 @@ |
||
22 | 22 | protected $primaryKey; |
23 | 23 | protected $cols = []; |
24 | 24 | |
25 | - public function ifNotExists():CreateTableInterface{return $this->_ifNotExists();} |
|
26 | - public function name(string $dbname = null):CreateTableInterface{return $this->_name($dbname);} |
|
25 | + public function ifNotExists():CreateTableInterface{return $this->_ifNotExists(); } |
|
26 | + public function name(string $dbname = null):CreateTableInterface{return $this->_name($dbname); } |
|
27 | 27 | |
28 | 28 | public function execute(){ |
29 | 29 | // TODO: Implement execute() method. |
@@ -28,9 +28,9 @@ |
||
28 | 28 | return (new class($this->DBDriver, $this->dialect) extends StatementAbstract implements CreateDatabaseInterface{ |
29 | 29 | use CharsetTrait, IfNotExistsTrait, NameTrait; |
30 | 30 | |
31 | - public function ifNotExists():CreateDatabaseInterface{return $this->_ifNotExists();} |
|
32 | - public function name(string $dbname = null):CreateDatabaseInterface{return $this->_name($dbname);} |
|
33 | - public function collate(string $collation):CreateDatabaseInterface{return $this->_collate($collation);} |
|
31 | + public function ifNotExists():CreateDatabaseInterface{return $this->_ifNotExists(); } |
|
32 | + public function name(string $dbname = null):CreateDatabaseInterface{return $this->_name($dbname); } |
|
33 | + public function collate(string $collation):CreateDatabaseInterface{return $this->_collate($collation); } |
|
34 | 34 | |
35 | 35 | public function sql():string{ |
36 | 36 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | class CreateTable extends CreateTableAbstract{ |
20 | 20 | use CharsetTrait; |
21 | 21 | |
22 | - public function collate(string $collation):CreateTableInterface{return $this->_collate($collation);} |
|
22 | + public function collate(string $collation):CreateTableInterface{return $this->_collate($collation); } |
|
23 | 23 | |
24 | 24 | public function sql():string{ |
25 | 25 | # var_dump($this->cols); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | 'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT', 'SERIAL', 'BOOLEAN', 'UUID']; |
57 | 57 | |
58 | 58 | $field[] = (is_int($length) || is_string($length) && count(explode(',', $length)) === 2) && !in_array($type, $nolengthtypes) |
59 | - ? $type.'('. $length . ')' |
|
59 | + ? $type.'('.$length.')' |
|
60 | 60 | : $type; |
61 | 61 | |
62 | 62 | if($attribute){ |
@@ -90,7 +90,7 @@ |
||
90 | 90 | $from = $table; |
91 | 91 | |
92 | 92 | if($ref){ |
93 | - $from = sprintf('%s AS %s', $table, $ref);// @todo: index hint |
|
93 | + $from = sprintf('%s AS %s', $table, $ref); // @todo: index hint |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $this->from[$ref ?? $table] = $from; |
@@ -141,7 +141,7 @@ |
||
141 | 141 | $where = []; |
142 | 142 | |
143 | 143 | foreach($this->where as $k => $v){ |
144 | - $last = $this->where[$k-1] ?? false; |
|
144 | + $last = $this->where[$k - 1] ?? false; |
|
145 | 145 | # print_r([$last, $v]); |
146 | 146 | |
147 | 147 | if(in_array($v, ['AND', 'OR', 'XOR', '(', ')'], true)){ |