Completed
Push — master ( 75a4bf...99f4b4 )
by BENOIT
03:23
created
src/Model/Adapter/Mysqli/EmulatedStatement.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -8,6 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     /**
10 10
      * @inheritDoc
11
+     * @param string $queryString
11 12
      */
12 13
     public function __construct(MysqliAdapter $connection, array $values = null, $queryString)
13 14
     {
Please login to merge, or discard this patch.
src/Model/Adapter/Mysqli/MysqliAdapter.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -321,7 +321,6 @@
 block discarded – undo
321 321
 
322 322
     /**
323 323
      * @param CredentialsInterface $credentials
324
-     * @param bool $resolveNamedParameters
325 324
      * @return MysqliAdapter
326 325
      */
327 326
     public static function factory(CredentialsInterface $credentials, array $options = null): self
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@
 block discarded – undo
15 15
 use BenTools\SimpleDBAL\Model\Exception\ParamBindingException;
16 16
 use GuzzleHttp\Promise\Promise;
17 17
 use GuzzleHttp\Promise\PromiseInterface;
18
+use Throwable;
18 19
 use mysqli;
19 20
 use mysqli_result;
20 21
 use mysqli_sql_exception;
21
-use Throwable;
22 22
 
23 23
 class MysqliAdapter implements AdapterInterface, TransactionAdapterInterface, ReconnectableAdapterInterface
24 24
 {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $this->cnx         = $cnx;
57 57
         $this->credentials = $credentials;
58 58
         if (null !== $options) {
59
-            $this->options     = array_replace($this->getDefaultOptions(), $options);
59
+            $this->options = array_replace($this->getDefaultOptions(), $options);
60 60
             if ($this->hasOption('charset')) {
61 61
                 $this->cnx->set_charset($this->getOption('charset'));
62 62
             }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         }
144 144
 
145 145
         try {
146
-            $wrappedStmt = self::wrapWithErrorHandler(function () use ($runnableQueryString) {
146
+            $wrappedStmt = self::wrapWithErrorHandler(function() use ($runnableQueryString) {
147 147
                 return $this->cnx->prepare($runnableQueryString);
148 148
             });
149 149
         } catch (mysqli_sql_exception $e) {
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             return $this->executeParallel($stmt, $values);
207 207
         }
208 208
 
209
-        $promise = new Promise(function () use (&$promise, $stmt, $values) {
209
+        $promise = new Promise(function() use (&$promise, $stmt, $values) {
210 210
             try {
211 211
                 $promise->resolve($this->execute($stmt, $values));
212 212
             } catch (Throwable $e) {
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         }
251 251
 
252 252
         $stmt->bind();
253
-        $promise = MysqliAsync::query($stmt->getRunnableQuery(), $cnx)->then(function ($result) use ($cnx, $stmt) {
253
+        $promise = MysqliAsync::query($stmt->getRunnableQuery(), $cnx)->then(function($result) use ($cnx, $stmt) {
254 254
             if (!$result instanceof mysqli_result) {
255 255
                 $result = null;
256 256
             }
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     private function runStmt(Statement $stmt)
264 264
     {
265 265
         try {
266
-            return self::wrapWithErrorHandler(function () use ($stmt) {
266
+            return self::wrapWithErrorHandler(function() use ($stmt) {
267 267
                 return $stmt->createResult();
268 268
             });
269 269
         } catch (mysqli_sql_exception $e) {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
      */
359 359
     private static function wrapWithErrorHandler(callable $run)
360 360
     {
361
-        $errorHandler = function ($errno, $errstr) {
361
+        $errorHandler = function($errno, $errstr) {
362 362
             throw new mysqli_sql_exception($errstr, $errno);
363 363
         };
364 364
         set_error_handler($errorHandler, E_WARNING);
Please login to merge, or discard this patch.
src/Model/Adapter/PDO/PDOAdapter.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -180,7 +180,6 @@
 block discarded – undo
180 180
     }
181 181
 
182 182
     /**
183
-     * @param \PDOStatement $wrappedStmt
184 183
      */
185 184
     private function runStmt(Statement $stmt)
186 185
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 use BenTools\SimpleDBAL\Contract\AdapterInterface;
6 6
 use BenTools\SimpleDBAL\Contract\CredentialsInterface;
7 7
 use BenTools\SimpleDBAL\Contract\ReconnectableAdapterInterface;
8
-use BenTools\SimpleDBAL\Contract\StatementInterface;
9 8
 use BenTools\SimpleDBAL\Contract\ResultInterface;
9
+use BenTools\SimpleDBAL\Contract\StatementInterface;
10 10
 use BenTools\SimpleDBAL\Contract\TransactionAdapterInterface;
11 11
 use BenTools\SimpleDBAL\Model\ConfigurableTrait;
12 12
 use BenTools\SimpleDBAL\Model\Exception\AccessDeniedException;
Please login to merge, or discard this patch.
src/Model/Adapter/PDO/Result.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     /**
29 29
      * Result constructor.
30 30
      * @param PDO $pdo
31
-     * @param Statement $stmt
31
+     * @param PDOStatement $stmt
32 32
      */
33 33
     public function __construct(PDO $pdo, PDOStatement $stmt = null)
34 34
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                     }
Please login to merge, or discard this patch.
src/Model/Adapter/PDO/Statement.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -126,6 +126,7 @@
 block discarded – undo
126 126
 
127 127
     /**
128 128
      * @param $var
129
+     * @param string $value
129 130
      * @return int
130 131
      */
131 132
     protected function getPdoType($value)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 namespace BenTools\SimpleDBAL\Model\Adapter\PDO;
4 4
 
5 5
 use BenTools\SimpleDBAL\Contract\AdapterInterface;
6
-use BenTools\SimpleDBAL\Contract\StatementInterface;
7 6
 use BenTools\SimpleDBAL\Contract\ResultInterface;
7
+use BenTools\SimpleDBAL\Contract\StatementInterface;
8 8
 use BenTools\SimpleDBAL\Model\StatementTrait;
9 9
 use PDO;
10 10
 use PDOStatement;
Please login to merge, or discard this patch.
src/Model/StatementTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Model/Adapter/Mysqli/Statement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Model/Adapter/Mysqli/MysqliAsync.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/Model/Adapter/Mysqli/Result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                     }
Please login to merge, or discard this patch.