@@ -310,8 +310,8 @@ |
||
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
313 | - * RETORNAR O ULTIMO ID INSERIDO |
|
314 | - */ |
|
313 | + * RETORNAR O ULTIMO ID INSERIDO |
|
314 | + */ |
|
315 | 315 | private function lastId() |
316 | 316 | { |
317 | 317 | $this->getInstance(); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | private function getInstance(): ?PDO |
34 | 34 | { |
35 | - if (strpos($_SERVER['SERVER_NAME'], "homologacao") && !strpos($this->database, "Homologacao") ) |
|
35 | + if (strpos($_SERVER['SERVER_NAME'], "homologacao") && !strpos($this->database, "Homologacao")) |
|
36 | 36 | $this->database .= "Homologacao"; |
37 | 37 | |
38 | 38 | if (!isset($this->instance)) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $this->prepare = $this->instance->prepare($query); |
56 | 56 | $this->prepare->execute($params); |
57 | 57 | } catch (PDOException $e) { |
58 | - Connect::setError($e,$query); |
|
58 | + Connect::setError($e, $query); |
|
59 | 59 | return false; |
60 | 60 | } |
61 | 61 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @param $prepare |
67 | 67 | * @return int |
68 | 68 | */ |
69 | - protected function count($prepare=null): int |
|
69 | + protected function count($prepare = null): int |
|
70 | 70 | { |
71 | 71 | try { |
72 | 72 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @param $prepare |
85 | 85 | * @return array|false |
86 | 86 | */ |
87 | - protected function fetchArrayAssoc($prepare=null): array |
|
87 | + protected function fetchArrayAssoc($prepare = null): array |
|
88 | 88 | { |
89 | 89 | try { |
90 | 90 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param $prepare |
102 | 102 | * @return array|false |
103 | 103 | */ |
104 | - protected function fetchArrayObj($prepare=null): array |
|
104 | + protected function fetchArrayObj($prepare = null): array |
|
105 | 105 | { |
106 | 106 | try { |
107 | 107 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @param String|null $class |
120 | 120 | * @return array|false |
121 | 121 | */ |
122 | - protected function fetchArrayClass($prepare=null, String $class=null): array |
|
122 | + protected function fetchArrayClass($prepare = null, String $class = null): array |
|
123 | 123 | { |
124 | 124 | try { |
125 | 125 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @param $prepare |
138 | 138 | * @return array|false |
139 | 139 | */ |
140 | - protected function fetchOneAssoc($prepare=null): array |
|
140 | + protected function fetchOneAssoc($prepare = null): array |
|
141 | 141 | { |
142 | 142 | try { |
143 | 143 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @param $prepare |
154 | 154 | * @return stdClass|false |
155 | 155 | */ |
156 | - protected function fetchOneObj($prepare=null): stdClass |
|
156 | + protected function fetchOneObj($prepare = null): stdClass |
|
157 | 157 | { |
158 | 158 | try { |
159 | 159 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @param String|null $class |
171 | 171 | * @return array|false |
172 | 172 | */ |
173 | - protected function fetchOneClass($prepare=null, String $class=null): object |
|
173 | + protected function fetchOneClass($prepare = null, String $class = null): object |
|
174 | 174 | { |
175 | 175 | try { |
176 | 176 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
@@ -244,12 +244,12 @@ discard block |
||
244 | 244 | $this->prepare->execute($params); |
245 | 245 | |
246 | 246 | if (!empty($class)) { |
247 | - $rs = $this->fetchArrayClass($this->prepare,$class); |
|
247 | + $rs = $this->fetchArrayClass($this->prepare, $class); |
|
248 | 248 | } else { |
249 | 249 | $rs = $this->fetchArrayObj($this->prepare); |
250 | 250 | } |
251 | 251 | } catch (PDOException $e) { |
252 | - Connect::setError($e,$sql); |
|
252 | + Connect::setError($e, $sql); |
|
253 | 253 | return false; |
254 | 254 | } |
255 | 255 | return $rs; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $this->prepare = $this->instance->prepare($sql); |
268 | 268 | $rs = $this->prepare->execute($params); |
269 | 269 | } catch (PDOException $e) { |
270 | - Connect::setError($e,$sql); |
|
270 | + Connect::setError($e, $sql); |
|
271 | 271 | return false; |
272 | 272 | } |
273 | 273 | return $rs; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $query = $this->instance->prepare($sql); |
286 | 286 | $rs = $query->execute($params); |
287 | 287 | } catch (PDOException $e) { |
288 | - Connect::setError($e,$sql); |
|
288 | + Connect::setError($e, $sql); |
|
289 | 289 | return false; |
290 | 290 | } |
291 | 291 | return $rs; |
@@ -299,11 +299,11 @@ discard block |
||
299 | 299 | protected function deleteDB($sql, $params = null): bool |
300 | 300 | { |
301 | 301 | try { |
302 | - $this->getInstance();; |
|
302 | + $this->getInstance(); ; |
|
303 | 303 | $this->prepare = $this->instance->prepare($sql); |
304 | 304 | $rs = $this->prepare->execute($params); |
305 | 305 | } catch (PDOException $e) { |
306 | - Connect::setError($e,$sql); |
|
306 | + Connect::setError($e, $sql); |
|
307 | 307 | return false; |
308 | 308 | } |
309 | 309 | return $rs; |
@@ -32,8 +32,9 @@ |
||
32 | 32 | */ |
33 | 33 | private function getInstance(): ?PDO |
34 | 34 | { |
35 | - if (strpos($_SERVER['SERVER_NAME'], "homologacao") && !strpos($this->database, "Homologacao") ) |
|
36 | - $this->database .= "Homologacao"; |
|
35 | + if (strpos($_SERVER['SERVER_NAME'], "homologacao") && !strpos($this->database, "Homologacao") ) { |
|
36 | + $this->database .= "Homologacao"; |
|
37 | + } |
|
37 | 38 | |
38 | 39 | if (!isset($this->instance)) { |
39 | 40 | $this->instance = Connect::getInstance($this->database); |