@@ -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, |
@@ -32,12 +32,12 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | if (stripos($sql, ' LIMIT ') === false) { |
| 35 | - $sql = $sql . " LIMIT x, y"; |
|
| 35 | + $sql = $sql." LIMIT x, y"; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | return preg_replace( |
| 39 | 39 | '~(\s[Ll][Ii][Mm][Ii][Tt])\s.*?,\s*.*~', |
| 40 | - '$1 ' . $start .', ' .$qty, |
|
| 40 | + '$1 '.$start.', '.$qty, |
|
| 41 | 41 | $sql |
| 42 | 42 | ); |
| 43 | 43 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | public function concat($str1, $str2 = null) |
| 11 | 11 | { |
| 12 | - return "concat(" . implode(func_get_args(), ', ') . ")"; |
|
| 12 | + return "concat(".implode(func_get_args(), ', ').")"; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | /** |
@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | if (stripos($sql, ' LIMIT ') === false) { |
| 29 | - $sql = $sql . " LIMIT x, y"; |
|
| 29 | + $sql = $sql." LIMIT x, y"; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | return preg_replace( |
| 33 | 33 | '~(\s[Ll][Ii][Mm][Ii][Tt])\s.*?,\s*.*~', |
| 34 | - '$1 ' . $start .', ' .$qty, |
|
| 34 | + '$1 '.$start.', '.$qty, |
|
| 35 | 35 | $sql |
| 36 | 36 | ); |
| 37 | 37 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | return preg_replace( |
| 42 | 42 | '~(\s[Tt][Oo][Pp])\s.*?\d+\s~', |
| 43 | - '$1 ' . $qty . ' ', |
|
| 43 | + '$1 '.$qty.' ', |
|
| 44 | 44 | $sql |
| 45 | 45 | ); |
| 46 | 46 | } |
@@ -26,12 +26,12 @@ |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | if (stripos($sql, ' LIMIT ') === false) { |
| 29 | - $sql = $sql . " LIMIT x OFFSET y"; |
|
| 29 | + $sql = $sql." LIMIT x OFFSET y"; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | return preg_replace( |
| 33 | 33 | '~(\s[Ll][Ii][Mm][Ii][Tt])\s.*?\s([Oo][Ff][Ff][Ss][Ee][Tt])\s.*~', |
| 34 | - '$1 ' . $qty .' $2 ' .$start, |
|
| 34 | + '$1 '.$qty.' $2 '.$start, |
|
| 35 | 35 | $sql |
| 36 | 36 | ); |
| 37 | 37 | } |
@@ -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); |
@@ -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 | } |
@@ -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; |