@@ -67,7 +67,7 @@ |
||
| 67 | 67 | } |
| 68 | 68 | public function next() |
| 69 | 69 | { |
| 70 | - $this->fetched ++; |
|
| 70 | + $this->fetched++; |
|
| 71 | 71 | $this->last = \ibase_fetch_assoc($this->result, \IBASE_TEXT); |
| 72 | 72 | } |
| 73 | 73 | public function valid() |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $this->connect(); |
| 53 | 53 | $statement = \ibase_prepare($this->transaction !== null ? $this->transaction : $this->lnk, $sql); |
| 54 | 54 | if ($statement === false) { |
| 55 | - throw new DBException('Prepare error: ' . \ibase_errmsg()); |
|
| 55 | + throw new DBException('Prepare error: '.\ibase_errmsg()); |
|
| 56 | 56 | } |
| 57 | 57 | return new Statement( |
| 58 | 58 | $statement, |
@@ -24,28 +24,28 @@ |
||
| 24 | 24 | foreach ($data as $i => $v) { |
| 25 | 25 | switch (gettype($v)) { |
| 26 | 26 | case 'boolean': |
| 27 | - $this->statement->bindValue($i+1, $v, \PDO::PARAM_BOOL); |
|
| 27 | + $this->statement->bindValue($i + 1, $v, \PDO::PARAM_BOOL); |
|
| 28 | 28 | break; |
| 29 | 29 | case 'integer': |
| 30 | - $this->statement->bindValue($i+1, $v, \PDO::PARAM_INT); |
|
| 30 | + $this->statement->bindValue($i + 1, $v, \PDO::PARAM_INT); |
|
| 31 | 31 | break; |
| 32 | 32 | case 'NULL': |
| 33 | - $this->statement->bindValue($i+1, $v, \PDO::PARAM_NULL); |
|
| 33 | + $this->statement->bindValue($i + 1, $v, \PDO::PARAM_NULL); |
|
| 34 | 34 | break; |
| 35 | 35 | case 'double': |
| 36 | - $this->statement->bindValue($i+1, $v); |
|
| 36 | + $this->statement->bindValue($i + 1, $v); |
|
| 37 | 37 | break; |
| 38 | 38 | default: |
| 39 | 39 | // keep in mind oracle needs a transaction when inserting LOBs, aside from the specific syntax: |
| 40 | 40 | // INSERT INTO table (column, lobcolumn) VALUES (?, ?, EMPTY_BLOB()) RETURNING lobcolumn INTO ? |
| 41 | 41 | if (is_resource($v) && get_resource_type($v) === 'stream') { |
| 42 | - $this->statement->bindParam($i+1, $v, \PDO::PARAM_LOB); |
|
| 42 | + $this->statement->bindParam($i + 1, $v, \PDO::PARAM_LOB); |
|
| 43 | 43 | continue; |
| 44 | 44 | } |
| 45 | 45 | if (!is_string($data[$i])) { |
| 46 | 46 | $data[$i] = serialize($data[$i]); |
| 47 | 47 | } |
| 48 | - $this->statement->bindValue($i+1, $v); |
|
| 48 | + $this->statement->bindValue($i + 1, $v); |
|
| 49 | 49 | break; |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | } |
| 56 | 56 | public function next() |
| 57 | 57 | { |
| 58 | - $this->fetched ++; |
|
| 58 | + $this->fetched++; |
|
| 59 | 59 | $this->last = $this->statement->fetch(\PDO::FETCH_ASSOC); |
| 60 | 60 | } |
| 61 | 61 | public function valid() |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | isset($this->connection['opts']) ? $this->connection['opts'] : [] |
| 45 | 45 | ); |
| 46 | 46 | } catch (\PDOException $e) { |
| 47 | - throw new DBException('Connect error: ' . $e->getMessage()); |
|
| 47 | + throw new DBException('Connect error: '.$e->getMessage()); |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $instance->setDefault($data['default']); |
| 48 | 48 | } |
| 49 | 49 | if ($instance->getBasicType() === 'enum' && strpos($instance->getType(), 'enum(') === 0) { |
| 50 | - $temp = array_map(function ($v) { |
|
| 50 | + $temp = array_map(function($v) { |
|
| 51 | 51 | return str_replace("''", "'", $v); |
| 52 | 52 | }, explode("','", substr($instance->getType(), 6, -2))); |
| 53 | 53 | $instance->setValues($temp); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | public function setPrimaryKey($column) : Table |
| 79 | 79 | { |
| 80 | 80 | if (!is_array($column)) { |
| 81 | - $column = [ $column ]; |
|
| 81 | + $column = [$column]; |
|
| 82 | 82 | } |
| 83 | 83 | $this->data['primary'] = $column; |
| 84 | 84 | return $this; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | if (!isset($name)) { |
| 168 | - $name = $toTable->getName() . '_' . implode('_', array_keys($keymap)); |
|
| 168 | + $name = $toTable->getName().'_'.implode('_', array_keys($keymap)); |
|
| 169 | 169 | } |
| 170 | 170 | $this->addRelation(new TableRelation( |
| 171 | 171 | $name, |
@@ -65,27 +65,27 @@ discard block |
||
| 65 | 65 | $fields = []; |
| 66 | 66 | $exists = false; |
| 67 | 67 | foreach ($relation->table->getColumns() as $column) { |
| 68 | - $fields[$column] = $row[$name . static::SEP . $column]; |
|
| 69 | - if (!$exists && $row[$name . static::SEP . $column] !== null) { |
|
| 68 | + $fields[$column] = $row[$name.static::SEP.$column]; |
|
| 69 | + if (!$exists && $row[$name.static::SEP.$column] !== null) { |
|
| 70 | 70 | $exists = true; |
| 71 | 71 | } |
| 72 | - $remove[] = $name . static::SEP . $column; |
|
| 72 | + $remove[] = $name.static::SEP.$column; |
|
| 73 | 73 | } |
| 74 | 74 | $temp = &$result; |
| 75 | 75 | $parts = explode(static::SEP, $name); |
| 76 | 76 | $name = array_pop($parts); |
| 77 | 77 | $full = ''; |
| 78 | 78 | foreach ($parts as $item) { |
| 79 | - $full = $full ? $full . static::SEP . $item : $item; |
|
| 79 | + $full = $full ? $full.static::SEP.$item : $item; |
|
| 80 | 80 | $temp = &$temp[$item]; |
| 81 | 81 | $rpk = []; |
| 82 | 82 | foreach ($this->relations[$full][0]->table->getPrimaryKey() as $pkey) { |
| 83 | - $rpk[$field] = $row[$full . static::SEP . $field]; |
|
| 83 | + $rpk[$field] = $row[$full.static::SEP.$field]; |
|
| 84 | 84 | } |
| 85 | 85 | $temp = &$temp[json_encode($rpk)]; |
| 86 | 86 | } |
| 87 | 87 | if (!isset($temp[$name])) { |
| 88 | - $temp[$name] = $relation->many ? [ '___clean' => true ] : null; |
|
| 88 | + $temp[$name] = $relation->many ? ['___clean' => true] : null; |
|
| 89 | 89 | } |
| 90 | 90 | $temp = &$temp[$name]; |
| 91 | 91 | if ($exists) { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | return; |
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | - $this->fetched ++; |
|
| 147 | + $this->fetched++; |
|
| 148 | 148 | while ($this->result->valid()) { |
| 149 | 149 | $row = $this->result->current(); |
| 150 | 150 | $pk = []; |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | if (!$this->statement->execute()) { |
| 86 | - throw new DBException('Prepared execute error: ' . $this->statement->error); |
|
| 86 | + throw new DBException('Prepared execute error: '.$this->statement->error); |
|
| 87 | 87 | } |
| 88 | 88 | return new Result($this->statement); |
| 89 | 89 | } |