@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | throw new NotAvailableException("Extension 'PDO' is not loaded"); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (!extension_loaded('pdo_' . strtolower($connUri->getScheme()))) { |
|
| 37 | - throw new NotAvailableException("Extension 'pdo_" . strtolower($connUri->getScheme()) . "' is not loaded"); |
|
| 36 | + if (!extension_loaded('pdo_'.strtolower($connUri->getScheme()))) { |
|
| 37 | + throw new NotAvailableException("Extension 'pdo_".strtolower($connUri->getScheme())."' is not loaded"); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $strcnn = $this->createPboConnStr($connUri); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $pdoConnectionString, |
| 50 | 50 | $this->connectionUri->getUsername(), |
| 51 | 51 | $this->connectionUri->getPassword(), |
| 52 | - (array) $preOptions |
|
| 52 | + (array)$preOptions |
|
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | 55 | $this->connectionUri->withScheme($this->instance->getAttribute(PDO::ATTR_DRIVER_NAME)); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 59 | 59 | $this->instance->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); |
| 60 | 60 | |
| 61 | - foreach ((array) $postOptions as $key => $value) { |
|
| 61 | + foreach ((array)$postOptions as $key => $value) { |
|
| 62 | 62 | $this->instance->setAttribute($key, $value); |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | $host = $connUri->getHost(); |
| 69 | 69 | if (empty($host)) { |
| 70 | - return $connUri->getScheme() . ":" . $connUri->getPath(); |
|
| 70 | + return $connUri->getScheme().":".$connUri->getPath(); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $database = preg_replace('~^/~', '', $connUri->getPath()); |
@@ -75,16 +75,16 @@ discard block |
||
| 75 | 75 | $database = ";dbname=$database"; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $strcnn = $connUri->getScheme() . ":" |
|
| 79 | - . "host=" . $connUri->getHost() |
|
| 78 | + $strcnn = $connUri->getScheme().":" |
|
| 79 | + . "host=".$connUri->getHost() |
|
| 80 | 80 | . $database; |
| 81 | 81 | |
| 82 | 82 | if ($connUri->getPort() != "") { |
| 83 | - $strcnn .= ";port=" . $connUri->getPort(); |
|
| 83 | + $strcnn .= ";port=".$connUri->getPort(); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $query = $connUri->getQuery(); |
| 87 | - $strcnn .= ";" . implode(';', explode('&', $query)); |
|
| 87 | + $strcnn .= ";".implode(';', explode('&', $query)); |
|
| 88 | 88 | |
| 89 | 89 | return $strcnn; |
| 90 | 90 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | if (!empty($array)) { |
| 110 | 110 | foreach ($array as $key => $value) { |
| 111 | - $stmt->bindValue(":" . SqlBind::keyAdj($key), $value); |
|
| 111 | + $stmt->bindValue(":".SqlBind::keyAdj($key), $value); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -71,9 +71,9 @@ |
||
| 71 | 71 | |
| 72 | 72 | $host = $connUri->getHost(); |
| 73 | 73 | |
| 74 | - $tns = "(DESCRIPTION = " . |
|
| 75 | - " (ADDRESS = (PROTOCOL = $protocol)(HOST = $host)(PORT = $port)) " . |
|
| 76 | - " (CONNECT_DATA = (SERVICE_NAME = $svcName)) " . |
|
| 74 | + $tns = "(DESCRIPTION = ". |
|
| 75 | + " (ADDRESS = (PROTOCOL = $protocol)(HOST = $host)(PORT = $port)) ". |
|
| 76 | + " (CONNECT_DATA = (SERVICE_NAME = $svcName)) ". |
|
| 77 | 77 | ")"; |
| 78 | 78 | |
| 79 | 79 | return $tns; |
@@ -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, |
@@ -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(); |
@@ -13,7 +13,6 @@ discard block |
||
| 13 | 13 | * Anydataset files have extension ".anydata.xml" and have many classes to put and get data into anydataset xml file. |
| 14 | 14 | * Anydataset class just read and write files. To search elements you need use AnyIterator |
| 15 | 15 | * and IteratorFilter. Each row have a class Row. |
| 16 | - |
|
| 17 | 16 | * XML Structure |
| 18 | 17 | * <code> |
| 19 | 18 | * <anydataset> |
@@ -28,17 +27,14 @@ discard block |
||
| 28 | 27 | * </row> |
| 29 | 28 | * </anydataset> |
| 30 | 29 | * </code> |
| 31 | - |
|
| 32 | 30 | * How to use: |
| 33 | 31 | * <code> |
| 34 | 32 | * $any = new AnyDataset(); |
| 35 | 33 | * </code> |
| 36 | - |
|
| 37 | 34 | * |
| 38 | 35 | *@see Row |
| 39 | 36 | * @see AnyIterator |
| 40 | 37 | * @see IteratorFilter |
| 41 | - |
|
| 42 | 38 | */ |
| 43 | 39 | class AnyDataset |
| 44 | 40 | { |
@@ -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 | |