@@ -310,7 +310,9 @@ |
||
310 | 310 | |
311 | 311 | protected function quickSortExec($seq, $field) |
312 | 312 | { |
313 | - if (!count($seq)) return $seq; |
|
313 | + if (!count($seq)) { |
|
314 | + return $seq; |
|
315 | + } |
|
314 | 316 | |
315 | 317 | $k = $seq [0]; |
316 | 318 | $x = $y = array(); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | if (!is_null($attr)) { |
105 | 105 | $sr->addField($attr->nodeValue, $field->nodeValue); |
106 | 106 | } else { |
107 | - throw new \InvalidArgumentException('Malformed anydataset file ' . basename($filepath)); |
|
107 | + throw new \InvalidArgumentException('Malformed anydataset file '.basename($filepath)); |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | $sr->acceptChanges(); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $x = $y = array(); |
317 | 317 | |
318 | 318 | $cntSeq = count($seq); |
319 | - for ($i = 1; $i < $cntSeq; $i ++) { |
|
319 | + for ($i = 1; $i < $cntSeq; $i++) { |
|
320 | 320 | if ($seq[$i]->getField($field) <= $k->getField($field)) { |
321 | 321 | $x [] = $seq [$i]; |
322 | 322 | } else { |
@@ -308,6 +308,10 @@ discard block |
||
308 | 308 | return; |
309 | 309 | } |
310 | 310 | |
311 | + /** |
|
312 | + * @param SingleRow[] $seq |
|
313 | + * @param string $field |
|
314 | + */ |
|
311 | 315 | protected function quickSortExec($seq, $field) |
312 | 316 | { |
313 | 317 | if (!count($seq)) return $seq; |
@@ -329,7 +333,7 @@ discard block |
||
329 | 333 | |
330 | 334 | /** |
331 | 335 | * @param $document |
332 | - * @return array|string |
|
336 | + * @return string |
|
333 | 337 | */ |
334 | 338 | public static function fixUTF8($document) |
335 | 339 | { |
@@ -33,7 +33,9 @@ |
||
33 | 33 | if (($buffer !== false) && (trim($buffer) != "")) { |
34 | 34 | $this->_current++; |
35 | 35 | $this->_currentBuffer = $buffer; |
36 | - } else $this->readNextLine(); |
|
36 | + } else { |
|
37 | + $this->readNextLine(); |
|
38 | + } |
|
37 | 39 | } |
38 | 40 | } |
39 | 41 |
@@ -181,14 +181,14 @@ |
||
181 | 181 | $pat = "/$patDriver($patCredentials$patHost$patDatabase|$patFile)$patExtra/i"; |
182 | 182 | $parts = array(); |
183 | 183 | if (!preg_match($pat, $this->getDbConnectionString(), $parts)) { |
184 | - throw new InvalidArgumentException("Connection string " . $this->getDbConnectionString() . " is invalid! Please fix it."); |
|
184 | + throw new InvalidArgumentException("Connection string ".$this->getDbConnectionString()." is invalid! Please fix it."); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | // Set the Driver |
188 | 188 | $this->setDriver($parts ['driver']); |
189 | 189 | |
190 | 190 | if (!isset($parts['path']) && !isset($parts['host'])) { |
191 | - throw new InvalidArgumentException("Connection string " . $this->getDbConnectionString() . " is invalid! Please fix it."); |
|
191 | + throw new InvalidArgumentException("Connection string ".$this->getDbConnectionString()." is invalid! Please fix it."); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | public function __construct(ConnectionManagement $connMngt) |
12 | 12 | { |
13 | - $strcnn = $connMngt->getDriver() . ":" . $connMngt->getServer(); |
|
13 | + $strcnn = $connMngt->getDriver().":".$connMngt->getServer(); |
|
14 | 14 | |
15 | 15 | parent::__construct($connMngt, $strcnn, [], []); |
16 | 16 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $arg = str_replace("_", SQLBind::keyAdj($key), $paramSubstName); |
48 | 48 | |
49 | 49 | $count = 0; |
50 | - $sql = preg_replace("/(\[\[$key\]\]|:" . $key . "[\s\W]|:$key\$)/", $arg . ' ', $sql, -1, $count); |
|
50 | + $sql = preg_replace("/(\[\[$key\]\]|:".$key."[\s\W]|:$key\$)/", $arg.' ', $sql, -1, $count); |
|
51 | 51 | if ($count === 0) { |
52 | 52 | unset($params[$key]); |
53 | 53 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public function __construct(ConnectionManagement $connMngt) |
14 | 14 | { |
15 | - $strcnn = $connMngt->getDriver() . ":dbname=" . DBOci8Driver::getTnsString($connMngt); |
|
15 | + $strcnn = $connMngt->getDriver().":dbname=".DBOci8Driver::getTnsString($connMngt); |
|
16 | 16 | |
17 | 17 | $postOptions = [ |
18 | 18 | PDO::ATTR_EMULATE_PREPARES => true |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | $start = 0; |
87 | 87 | if ($debug) { |
88 | 88 | $log = LogHandler::getInstance(); |
89 | - $log->debug("Class name: " . get_class($this)); |
|
90 | - $log->debug("SQL: " . $sql); |
|
89 | + $log->debug("Class name: ".get_class($this)); |
|
90 | + $log->debug("SQL: ".$sql); |
|
91 | 91 | if (!is_null($param)) { |
92 | 92 | $s = ""; |
93 | 93 | foreach ($param as $key => $value) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | if ($debug) { |
112 | 112 | $end = microtime(true); |
113 | - $log->debug("Execution time: " . ($end - $start) . " seconds "); |
|
113 | + $log->debug("Execution time: ".($end - $start)." seconds "); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | return $id; |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $start = 0; |
132 | 132 | if ($debug) { |
133 | 133 | $log = LogHandler::getInstance(); |
134 | - $log->debug("Class name: " . get_class($this)); |
|
135 | - $log->debug("SQL: " . $sql); |
|
134 | + $log->debug("Class name: ".get_class($this)); |
|
135 | + $log->debug("SQL: ".$sql); |
|
136 | 136 | if (!is_null($param)) { |
137 | 137 | $s = ""; |
138 | 138 | foreach ($param as $key => $value) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $it = $db->getIterator($sql, $param, $ttl); |
149 | 149 | if ($debug) { |
150 | 150 | $end = microtime(true); |
151 | - $log->debug("Execution Time: " . ($end - $start) . " segundos "); |
|
151 | + $log->debug("Execution Time: ".($end - $start)." segundos "); |
|
152 | 152 | } |
153 | 153 | return $it; |
154 | 154 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $start = 0; |
162 | 162 | if ($debug) { |
163 | 163 | $log = LogHandler::getInstance(); |
164 | - $log->debug("Class name: " . get_class($this)); |
|
165 | - $log->debug("SQL: " . $sql); |
|
164 | + $log->debug("Class name: ".get_class($this)); |
|
165 | + $log->debug("SQL: ".$sql); |
|
166 | 166 | if (!is_null($param)) { |
167 | 167 | $s = ""; |
168 | 168 | foreach ($param as $key => $value) { |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $scalar = $this->_db->getScalar($sql, $param); |
179 | 179 | if ($debug) { |
180 | 180 | $end = microtime(true); |
181 | - $log->debug("Execution Time: " . ($end - $start) . " segundos "); |
|
181 | + $log->debug("Execution Time: ".($end - $start)." segundos "); |
|
182 | 182 | } |
183 | 183 | return $scalar; |
184 | 184 | } |
@@ -262,14 +262,14 @@ discard block |
||
262 | 262 | $fields = $sr->getFieldNames(); |
263 | 263 | } |
264 | 264 | |
265 | - $line .= '"' . implode('","', $fields) . '"' . "\n"; |
|
265 | + $line .= '"'.implode('","', $fields).'"'."\n"; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | $raw = array(); |
269 | 269 | foreach ($fields as $field) { |
270 | 270 | $raw[] = $sr->getField($field); |
271 | 271 | } |
272 | - $line .= '"' . implode('","', array_values($raw)) . '"' . "\n"; |
|
272 | + $line .= '"'.implode('","', array_values($raw)).'"'."\n"; |
|
273 | 273 | |
274 | 274 | if ($echoToBrowser) { |
275 | 275 | echo $line; |
@@ -63,9 +63,9 @@ |
||
63 | 63 | |
64 | 64 | $host = $connMngt->getServer(); |
65 | 65 | |
66 | - $tns = "(DESCRIPTION = " . |
|
67 | - " (ADDRESS = (PROTOCOL = $protocol)(HOST = $host)(PORT = $port)) " . |
|
68 | - " (CONNECT_DATA = (SERVICE_NAME = $svcName)) " . |
|
66 | + $tns = "(DESCRIPTION = ". |
|
67 | + " (ADDRESS = (PROTOCOL = $protocol)(HOST = $host)(PORT = $port)) ". |
|
68 | + " (CONNECT_DATA = (SERVICE_NAME = $svcName)) ". |
|
69 | 69 | ")"; |
70 | 70 | |
71 | 71 | return $tns; |
@@ -54,8 +54,8 @@ |
||
54 | 54 | if (!$handle) { |
55 | 55 | throw new DatasetException("Socket error: $errstr ($errno)"); |
56 | 56 | } else { |
57 | - $out = "GET " . $this->_path . " HTTP/1.1\r\n"; |
|
58 | - $out .= "Host: " . $this->_server . "\r\n"; |
|
57 | + $out = "GET ".$this->_path." HTTP/1.1\r\n"; |
|
58 | + $out .= "Host: ".$this->_server."\r\n"; |
|
59 | 59 | $out .= "Connection: Close\r\n\r\n"; |
60 | 60 | |
61 | 61 | fwrite($handle, $out); |