@@ -14,7 +14,7 @@ |
||
| 14 | 14 | /** |
| 15 | 15 | * @inheritDoc |
| 16 | 16 | */ |
| 17 | - public function getValues(): ?array |
|
| 17 | + public function getValues(): ? array |
|
| 18 | 18 | { |
| 19 | 19 | return $this->values; |
| 20 | 20 | } |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | return $this->queryString; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - $escape = function ($value) { |
|
| 166 | + $escape = function($value) { |
|
| 167 | 167 | if (null === $value) { |
| 168 | 168 | return 'NULL'; |
| 169 | 169 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public static function query(string $query, mysqli $cnx) |
| 34 | 34 | { |
| 35 | - $promise = new Promise(function () { |
|
| 35 | + $promise = new Promise(function() { |
|
| 36 | 36 | self::getInstance()->wait(); |
| 37 | 37 | }); |
| 38 | 38 | $cnx->query($query, MYSQLI_ASYNC); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | foreach ($this->queries as $l => $link) { |
| 120 | 120 | $promise = $this->getPromise($link); |
| 121 | - $cnx = $this->getConnection($link); |
|
| 121 | + $cnx = $this->getConnection($link); |
|
| 122 | 122 | try { |
| 123 | 123 | $result = $cnx->reap_async_query(); |
| 124 | 124 | if ($result instanceof mysqli_result) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | /** |
| 79 | 79 | * @inheritDoc |
| 80 | 80 | */ |
| 81 | - public function asRow(): ?array |
|
| 81 | + public function asRow(): ? array |
|
| 82 | 82 | { |
| 83 | 83 | if (null === $this->result) { |
| 84 | 84 | throw new DBALException("No mysqli_result object provided."); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $this->resetResultset(); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - $generator = function (\mysqli_result $result) { |
|
| 116 | + $generator = function(\mysqli_result $result) { |
|
| 117 | 117 | while ($row = $result->fetch_array(MYSQLI_NUM)) { |
| 118 | 118 | yield $row[0]; |
| 119 | 119 | } |
@@ -156,7 +156,7 @@ |
||
| 156 | 156 | return $this->stmt->queryString; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - $escape = function ($value) { |
|
| 159 | + $escape = function($value) { |
|
| 160 | 160 | if (null === $value) { |
| 161 | 161 | return 'NULL'; |
| 162 | 162 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | $this->credentials = $credentials; |
| 54 | 54 | if (null !== $options) { |
| 55 | - $this->options = array_replace($this->getDefaultOptions(), $options); |
|
| 55 | + $this->options = array_replace($this->getDefaultOptions(), $options); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | public function isConnected(): bool |
| 79 | 79 | { |
| 80 | 80 | try { |
| 81 | - self::wrapWithErrorHandler(function () { |
|
| 81 | + self::wrapWithErrorHandler(function() { |
|
| 82 | 82 | $this->cnx->getAttribute(PDO::ATTR_SERVER_INFO); |
| 83 | 83 | }); |
| 84 | 84 | return true; |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | public function executeAsync($stmt, array $values = null): PromiseInterface |
| 171 | 171 | { |
| 172 | - $promise = new Promise(function () use (&$promise, $stmt, $values) { |
|
| 172 | + $promise = new Promise(function() use (&$promise, $stmt, $values) { |
|
| 173 | 173 | try { |
| 174 | 174 | $promise->resolve($this->execute($stmt, $values)); |
| 175 | 175 | } catch (DBALException $e) { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | { |
| 187 | 187 | $wrappedStmt = $stmt->getWrappedStatement(); |
| 188 | 188 | try { |
| 189 | - self::wrapWithErrorHandler(function () use ($stmt, $wrappedStmt) { |
|
| 189 | + self::wrapWithErrorHandler(function() use ($stmt, $wrappedStmt) { |
|
| 190 | 190 | $stmt->bind(); |
| 191 | 191 | $wrappedStmt->execute(); |
| 192 | 192 | }); |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | */ |
| 274 | 274 | private static function wrapWithErrorHandler(callable $run) |
| 275 | 275 | { |
| 276 | - $errorHandler = function ($errno, $errstr) { |
|
| 276 | + $errorHandler = function($errno, $errstr) { |
|
| 277 | 277 | throw new PDOException($errstr, $errno); |
| 278 | 278 | }; |
| 279 | 279 | set_error_handler($errorHandler, E_WARNING); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * @inheritDoc |
| 78 | 78 | */ |
| 79 | - public function asRow(): ?array |
|
| 79 | + public function asRow(): ? array |
|
| 80 | 80 | { |
| 81 | 81 | if (null === $this->stmt) { |
| 82 | 82 | throw new DBALException("No \PDOStatement object provided."); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $this->resetResultset(); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - $generator = function (\PDOStatement $stmt) { |
|
| 114 | + $generator = function(\PDOStatement $stmt) { |
|
| 115 | 115 | while ($value = $stmt->fetchColumn(0)) { |
| 116 | 116 | yield $value; |
| 117 | 117 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | * |
| 31 | 31 | * @return array |
| 32 | 32 | */ |
| 33 | - public function getValues(): ?array; |
|
| 33 | + public function getValues(): ? array; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Return a cloned statement object with different values. |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * |
| 20 | 20 | * @return array|null |
| 21 | 21 | */ |
| 22 | - public function asRow(): ?array; |
|
| 22 | + public function asRow(): ? array; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Return an indexed array of items. |