@@ -11,7 +11,7 @@ |
||
| 11 | 11 | public function __construct(Uri $connUri) |
| 12 | 12 | { |
| 13 | 13 | $this->connectionUri = $connUri; |
| 14 | - $strconn = $connUri->getScheme(). ":dbname=" . DbOci8Driver::getTnsString($connUri); |
|
| 14 | + $strconn = $connUri->getScheme().":dbname=".DbOci8Driver::getTnsString($connUri); |
|
| 15 | 15 | |
| 16 | 16 | // Create Connection |
| 17 | 17 | $this->instance = new PDO( |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $iterator = $this->dbDriver->getIterator($sql, $params); |
| 54 | 54 | |
| 55 | 55 | $cacheItem->set($iterator->toArray()); |
| 56 | - $cacheItem->expiresAfter(DateInterval::createFromDateString($this->timeToCache . " seconds")); |
|
| 56 | + $cacheItem->expiresAfter(DateInterval::createFromDateString($this->timeToCache." seconds")); |
|
| 57 | 57 | |
| 58 | 58 | $this->cacheEngine->save($cacheItem); |
| 59 | 59 | } |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | // Define the query key |
| 80 | 80 | if (is_array($arKey2) && count($arKey2) > 0) { |
| 81 | - $key2 = ":" . md5(json_encode($arKey2)); |
|
| 81 | + $key2 = ":".md5(json_encode($arKey2)); |
|
| 82 | 82 | } else { |
| 83 | 83 | $key2 = ""; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - return "qry:" . $key1 . $key2; |
|
| 86 | + return "qry:".$key1.$key2; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | public function getScalar($sql, $array = null) |
@@ -78,8 +78,8 @@ |
||
| 78 | 78 | "/:$paramName([^\\w\\d]|$)/", |
| 79 | 79 | ], |
| 80 | 80 | [ |
| 81 | - $dbArg . '', |
|
| 82 | - $dbArg . '$1', |
|
| 81 | + $dbArg.'', |
|
| 82 | + $dbArg.'$1', |
|
| 83 | 83 | ], |
| 84 | 84 | $sql, |
| 85 | 85 | -1, |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $dataCursor = $this->mongoManager->executeQuery( |
| 125 | - $this->database . '.' . $collection, |
|
| 125 | + $this->database.'.'.$collection, |
|
| 126 | 126 | $this->getMongoFilterArray($filter) |
| 127 | 127 | ); |
| 128 | 128 | |
@@ -167,31 +167,31 @@ discard block |
||
| 167 | 167 | break; |
| 168 | 168 | |
| 169 | 169 | case Relation::GREATER_THAN: |
| 170 | - $result[$name] = [ '$gt' => $value ]; |
|
| 170 | + $result[$name] = ['$gt' => $value]; |
|
| 171 | 171 | break; |
| 172 | 172 | |
| 173 | 173 | case Relation::LESS_THAN: |
| 174 | - $result[$name] = [ '$lt' => $value ]; |
|
| 174 | + $result[$name] = ['$lt' => $value]; |
|
| 175 | 175 | break; |
| 176 | 176 | |
| 177 | 177 | case Relation::GREATER_OR_EQUAL_THAN: |
| 178 | - $result[$name] = [ '$gte' => $value ]; |
|
| 178 | + $result[$name] = ['$gte' => $value]; |
|
| 179 | 179 | break; |
| 180 | 180 | |
| 181 | 181 | case Relation::LESS_OR_EQUAL_THAN: |
| 182 | - $result[$name] = [ '$lte' => $value ]; |
|
| 182 | + $result[$name] = ['$lte' => $value]; |
|
| 183 | 183 | break; |
| 184 | 184 | |
| 185 | 185 | case Relation::NOT_EQUAL: |
| 186 | - $result[$name] = [ '$ne' => $value ]; |
|
| 186 | + $result[$name] = ['$ne' => $value]; |
|
| 187 | 187 | break; |
| 188 | 188 | |
| 189 | 189 | case Relation::STARTS_WITH: |
| 190 | - $result[$name] = [ '$regex' => "^$value" ]; |
|
| 190 | + $result[$name] = ['$regex' => "^$value"]; |
|
| 191 | 191 | break; |
| 192 | 192 | |
| 193 | 193 | case Relation::CONTAINS: |
| 194 | - $result[$name] = [ '$regex' => "$value" ]; |
|
| 194 | + $result[$name] = ['$regex' => "$value"]; |
|
| 195 | 195 | break; |
| 196 | 196 | |
| 197 | 197 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | $bulkWrite->delete($this->getMongoFilterArray($filter)); |
| 221 | 221 | $this->mongoManager->executeBulkWrite( |
| 222 | - $this->database . '.' . $collection, |
|
| 222 | + $this->database.'.'.$collection, |
|
| 223 | 223 | $bulkWrite, |
| 224 | 224 | $writeConcern |
| 225 | 225 | ); |
@@ -241,10 +241,10 @@ discard block |
||
| 241 | 241 | $idDocument = isset($data['_id']) ? $data['_id'] : null; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $data['updated'] = new UTCDateTime((new \DateTime())->getTimestamp()*1000); |
|
| 244 | + $data['updated'] = new UTCDateTime((new \DateTime())->getTimestamp() * 1000); |
|
| 245 | 245 | if (empty($idDocument)) { |
| 246 | 246 | $data['_id'] = $idDocument = new ObjectID(); |
| 247 | - $data['created'] = new UTCDateTime((new \DateTime())->getTimestamp()*1000); |
|
| 247 | + $data['created'] = new UTCDateTime((new \DateTime())->getTimestamp() * 1000); |
|
| 248 | 248 | $bulkWrite->insert($data); |
| 249 | 249 | } else { |
| 250 | 250 | $data['_id'] = $idDocument; |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | $this->mongoManager->executeBulkWrite( |
| 255 | - $this->database . "." . $document->getCollection(), |
|
| 255 | + $this->database.".".$document->getCollection(), |
|
| 256 | 256 | $bulkWrite, |
| 257 | 257 | $writeConcern |
| 258 | 258 | ); |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | return; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - $sql = "INSERT INTO Dogs (Breed, Name, Age) VALUES ('Cat', 'Doris', 7); " . |
|
| 132 | + $sql = "INSERT INTO Dogs (Breed, Name, Age) VALUES ('Cat', 'Doris', 7); ". |
|
| 133 | 133 | "INSERT INTO Dogs (Breed, Name, Age) VALUES ('Dog', 'Lolla', 1); "; |
| 134 | 134 | |
| 135 | 135 | $idInserted = $this->dbDriver->executeAndGetId($sql); |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $this->rows = array(); |
| 44 | - $rowsaux = preg_split("/" . $this->rowsep . "/", $linha); |
|
| 44 | + $rowsaux = preg_split("/".$this->rowsep."/", $linha); |
|
| 45 | 45 | sort($rowsaux); |
| 46 | 46 | foreach ($rowsaux as $value) { |
| 47 | - $colsaux = preg_split("/" . $this->colsep . "/", $value); |
|
| 47 | + $colsaux = preg_split("/".$this->colsep."/", $value); |
|
| 48 | 48 | if (count($colsaux) == count($fieldnames)) { |
| 49 | 49 | $this->rows[] = $value; |
| 50 | 50 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function moveNext() |
| 79 | 79 | { |
| 80 | - $cols = preg_split("/" . $this->colsep . "/", $this->rows[$this->current]); |
|
| 80 | + $cols = preg_split("/".$this->colsep."/", $this->rows[$this->current]); |
|
| 81 | 81 | $this->current++; |
| 82 | 82 | |
| 83 | 83 | $sr = new Row(); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | foreach ($fields as $field) { |
| 106 | 106 | $attr = $field->attributes->getNamedItem("name"); |
| 107 | 107 | if (is_null($attr)) { |
| 108 | - throw new \InvalidArgumentException('Malformed anydataset file ' . basename($filepath)); |
|
| 108 | + throw new \InvalidArgumentException('Malformed anydataset file '.basename($filepath)); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $sr->addField($attr->nodeValue, $field->nodeValue); |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | $left = $right = array(); |
| 327 | 327 | |
| 328 | 328 | $cntSeq = count($seq); |
| 329 | - for ($i = 1; $i < $cntSeq; $i ++) { |
|
| 329 | + for ($i = 1; $i < $cntSeq; $i++) { |
|
| 330 | 330 | if ($seq[$i]->get($field) <= $key->get($field)) { |
| 331 | 331 | $left[] = $seq[$i]; |
| 332 | 332 | } else { |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | return array_merge( |
| 338 | 338 | $this->quickSortExec($left, $field), |
| 339 | - [ $key ], |
|
| 339 | + [$key], |
|
| 340 | 340 | $this->quickSortExec($right, $field) |
| 341 | 341 | ); |
| 342 | 342 | } |
@@ -219,7 +219,7 @@ |
||
| 219 | 219 | if (is_array($this->row)) { |
| 220 | 220 | return json_decode(json_encode($this->row)); |
| 221 | 221 | } else { |
| 222 | - throw new UnexpectedValueException('I expected that getRawFormat is array() but ' . gettype($this->row) . ' was given'); |
|
| 222 | + throw new UnexpectedValueException('I expected that getRawFormat is array() but '.gettype($this->row).' was given'); |
|
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if (isset($pattern[$value])) { |
| 93 | 93 | $formatted = $pattern[$value]; |
| 94 | 94 | } else { |
| 95 | - $formatted = $delimitString . $value . $delimitString; |
|
| 95 | + $formatted = $delimitString.$value.$delimitString; |
|
| 96 | 96 | } |
| 97 | 97 | $prepareString[$key] = $formatted; |
| 98 | 98 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | foreach ((array)$field as $fld) { |
| 157 | 157 | $fldAr = explode('.', $fld); |
| 158 | 158 | $result[] = $this->deliFieldLeft |
| 159 | - . implode($this->deliFieldRight . '.' . $this->deliFieldLeft, $fldAr) |
|
| 159 | + . implode($this->deliFieldRight.'.'.$this->deliFieldLeft, $fldAr) |
|
| 160 | 160 | . $this->deliFieldRight; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -172,14 +172,14 @@ discard block |
||
| 172 | 172 | $tableAr = explode('.', $table); |
| 173 | 173 | |
| 174 | 174 | return $this->deliTableLeft |
| 175 | - . implode($this->deliTableRight . '.' . $this->deliTableLeft, $tableAr) |
|
| 175 | + . implode($this->deliTableRight.'.'.$this->deliTableLeft, $tableAr) |
|
| 176 | 176 | . $this->deliTableRight; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | public function forUpdate($sql) |
| 180 | 180 | { |
| 181 | 181 | if (!preg_match('#\bfor update\b#i', $sql)) { |
| 182 | - $sql = $sql . " FOR UPDATE "; |
|
| 182 | + $sql = $sql." FOR UPDATE "; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | return $sql; |