@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | */ |
21 | 21 | function sqlsrv_begin_transaction($conn): void |
22 | 22 | { |
23 | - error_clear_last(); |
|
24 | - $result = \sqlsrv_begin_transaction($conn); |
|
25 | - if ($result === false) { |
|
26 | - throw SqlsrvException::createFromPhpError(); |
|
27 | - } |
|
23 | + error_clear_last(); |
|
24 | + $result = \sqlsrv_begin_transaction($conn); |
|
25 | + if ($result === false) { |
|
26 | + throw SqlsrvException::createFromPhpError(); |
|
27 | + } |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | */ |
43 | 43 | function sqlsrv_cancel($stmt): void |
44 | 44 | { |
45 | - error_clear_last(); |
|
46 | - $result = \sqlsrv_cancel($stmt); |
|
47 | - if ($result === false) { |
|
48 | - throw SqlsrvException::createFromPhpError(); |
|
49 | - } |
|
45 | + error_clear_last(); |
|
46 | + $result = \sqlsrv_cancel($stmt); |
|
47 | + if ($result === false) { |
|
48 | + throw SqlsrvException::createFromPhpError(); |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | */ |
90 | 90 | function sqlsrv_client_info($conn): array |
91 | 91 | { |
92 | - error_clear_last(); |
|
93 | - $result = \sqlsrv_client_info($conn); |
|
94 | - if ($result === false) { |
|
95 | - throw SqlsrvException::createFromPhpError(); |
|
96 | - } |
|
97 | - return $result; |
|
92 | + error_clear_last(); |
|
93 | + $result = \sqlsrv_client_info($conn); |
|
94 | + if ($result === false) { |
|
95 | + throw SqlsrvException::createFromPhpError(); |
|
96 | + } |
|
97 | + return $result; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | */ |
108 | 108 | function sqlsrv_close($conn): void |
109 | 109 | { |
110 | - error_clear_last(); |
|
111 | - $result = \sqlsrv_close($conn); |
|
112 | - if ($result === false) { |
|
113 | - throw SqlsrvException::createFromPhpError(); |
|
114 | - } |
|
110 | + error_clear_last(); |
|
111 | + $result = \sqlsrv_close($conn); |
|
112 | + if ($result === false) { |
|
113 | + throw SqlsrvException::createFromPhpError(); |
|
114 | + } |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | */ |
132 | 132 | function sqlsrv_commit($conn): void |
133 | 133 | { |
134 | - error_clear_last(); |
|
135 | - $result = \sqlsrv_commit($conn); |
|
136 | - if ($result === false) { |
|
137 | - throw SqlsrvException::createFromPhpError(); |
|
138 | - } |
|
134 | + error_clear_last(); |
|
135 | + $result = \sqlsrv_commit($conn); |
|
136 | + if ($result === false) { |
|
137 | + throw SqlsrvException::createFromPhpError(); |
|
138 | + } |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -183,11 +183,11 @@ discard block |
||
183 | 183 | */ |
184 | 184 | function sqlsrv_configure(string $setting, $value): void |
185 | 185 | { |
186 | - error_clear_last(); |
|
187 | - $result = \sqlsrv_configure($setting, $value); |
|
188 | - if ($result === false) { |
|
189 | - throw SqlsrvException::createFromPhpError(); |
|
190 | - } |
|
186 | + error_clear_last(); |
|
187 | + $result = \sqlsrv_configure($setting, $value); |
|
188 | + if ($result === false) { |
|
189 | + throw SqlsrvException::createFromPhpError(); |
|
190 | + } |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | */ |
203 | 203 | function sqlsrv_execute($stmt): void |
204 | 204 | { |
205 | - error_clear_last(); |
|
206 | - $result = \sqlsrv_execute($stmt); |
|
207 | - if ($result === false) { |
|
208 | - throw SqlsrvException::createFromPhpError(); |
|
209 | - } |
|
205 | + error_clear_last(); |
|
206 | + $result = \sqlsrv_execute($stmt); |
|
207 | + if ($result === false) { |
|
208 | + throw SqlsrvException::createFromPhpError(); |
|
209 | + } |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | |
@@ -225,11 +225,11 @@ discard block |
||
225 | 225 | */ |
226 | 226 | function sqlsrv_free_stmt($stmt): void |
227 | 227 | { |
228 | - error_clear_last(); |
|
229 | - $result = \sqlsrv_free_stmt($stmt); |
|
230 | - if ($result === false) { |
|
231 | - throw SqlsrvException::createFromPhpError(); |
|
232 | - } |
|
228 | + error_clear_last(); |
|
229 | + $result = \sqlsrv_free_stmt($stmt); |
|
230 | + if ($result === false) { |
|
231 | + throw SqlsrvException::createFromPhpError(); |
|
232 | + } |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | |
@@ -253,16 +253,16 @@ discard block |
||
253 | 253 | */ |
254 | 254 | function sqlsrv_get_field($stmt, int $fieldIndex, int $getAsType = null) |
255 | 255 | { |
256 | - error_clear_last(); |
|
257 | - if ($getAsType !== null) { |
|
258 | - $result = \sqlsrv_get_field($stmt, $fieldIndex, $getAsType); |
|
259 | - } else { |
|
260 | - $result = \sqlsrv_get_field($stmt, $fieldIndex); |
|
261 | - } |
|
262 | - if ($result === false) { |
|
263 | - throw SqlsrvException::createFromPhpError(); |
|
264 | - } |
|
265 | - return $result; |
|
256 | + error_clear_last(); |
|
257 | + if ($getAsType !== null) { |
|
258 | + $result = \sqlsrv_get_field($stmt, $fieldIndex, $getAsType); |
|
259 | + } else { |
|
260 | + $result = \sqlsrv_get_field($stmt, $fieldIndex); |
|
261 | + } |
|
262 | + if ($result === false) { |
|
263 | + throw SqlsrvException::createFromPhpError(); |
|
264 | + } |
|
265 | + return $result; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | |
@@ -278,12 +278,12 @@ discard block |
||
278 | 278 | */ |
279 | 279 | function sqlsrv_next_result($stmt): ?bool |
280 | 280 | { |
281 | - error_clear_last(); |
|
282 | - $result = \sqlsrv_next_result($stmt); |
|
283 | - if ($result === false) { |
|
284 | - throw SqlsrvException::createFromPhpError(); |
|
285 | - } |
|
286 | - return $result; |
|
281 | + error_clear_last(); |
|
282 | + $result = \sqlsrv_next_result($stmt); |
|
283 | + if ($result === false) { |
|
284 | + throw SqlsrvException::createFromPhpError(); |
|
285 | + } |
|
286 | + return $result; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | |
@@ -299,12 +299,12 @@ discard block |
||
299 | 299 | */ |
300 | 300 | function sqlsrv_num_fields($stmt): int |
301 | 301 | { |
302 | - error_clear_last(); |
|
303 | - $result = \sqlsrv_num_fields($stmt); |
|
304 | - if ($result === false) { |
|
305 | - throw SqlsrvException::createFromPhpError(); |
|
306 | - } |
|
307 | - return $result; |
|
302 | + error_clear_last(); |
|
303 | + $result = \sqlsrv_num_fields($stmt); |
|
304 | + if ($result === false) { |
|
305 | + throw SqlsrvException::createFromPhpError(); |
|
306 | + } |
|
307 | + return $result; |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | |
@@ -327,12 +327,12 @@ discard block |
||
327 | 327 | */ |
328 | 328 | function sqlsrv_num_rows($stmt): int |
329 | 329 | { |
330 | - error_clear_last(); |
|
331 | - $result = \sqlsrv_num_rows($stmt); |
|
332 | - if ($result === false) { |
|
333 | - throw SqlsrvException::createFromPhpError(); |
|
334 | - } |
|
335 | - return $result; |
|
330 | + error_clear_last(); |
|
331 | + $result = \sqlsrv_num_rows($stmt); |
|
332 | + if ($result === false) { |
|
333 | + throw SqlsrvException::createFromPhpError(); |
|
334 | + } |
|
335 | + return $result; |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | |
@@ -359,18 +359,18 @@ discard block |
||
359 | 359 | */ |
360 | 360 | function sqlsrv_prepare($conn, string $sql, array $params = null, array $options = null) |
361 | 361 | { |
362 | - error_clear_last(); |
|
363 | - if ($options !== null) { |
|
364 | - $result = \sqlsrv_prepare($conn, $sql, $params, $options); |
|
365 | - } elseif ($params !== null) { |
|
366 | - $result = \sqlsrv_prepare($conn, $sql, $params); |
|
367 | - } else { |
|
368 | - $result = \sqlsrv_prepare($conn, $sql); |
|
369 | - } |
|
370 | - if ($result === false) { |
|
371 | - throw SqlsrvException::createFromPhpError(); |
|
372 | - } |
|
373 | - return $result; |
|
362 | + error_clear_last(); |
|
363 | + if ($options !== null) { |
|
364 | + $result = \sqlsrv_prepare($conn, $sql, $params, $options); |
|
365 | + } elseif ($params !== null) { |
|
366 | + $result = \sqlsrv_prepare($conn, $sql, $params); |
|
367 | + } else { |
|
368 | + $result = \sqlsrv_prepare($conn, $sql); |
|
369 | + } |
|
370 | + if ($result === false) { |
|
371 | + throw SqlsrvException::createFromPhpError(); |
|
372 | + } |
|
373 | + return $result; |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | |
@@ -396,18 +396,18 @@ discard block |
||
396 | 396 | */ |
397 | 397 | function sqlsrv_query($conn, string $sql, array $params = null, array $options = null) |
398 | 398 | { |
399 | - error_clear_last(); |
|
400 | - if ($options !== null) { |
|
401 | - $result = \sqlsrv_query($conn, $sql, $params, $options); |
|
402 | - } elseif ($params !== null) { |
|
403 | - $result = \sqlsrv_query($conn, $sql, $params); |
|
404 | - } else { |
|
405 | - $result = \sqlsrv_query($conn, $sql); |
|
406 | - } |
|
407 | - if ($result === false) { |
|
408 | - throw SqlsrvException::createFromPhpError(); |
|
409 | - } |
|
410 | - return $result; |
|
399 | + error_clear_last(); |
|
400 | + if ($options !== null) { |
|
401 | + $result = \sqlsrv_query($conn, $sql, $params, $options); |
|
402 | + } elseif ($params !== null) { |
|
403 | + $result = \sqlsrv_query($conn, $sql, $params); |
|
404 | + } else { |
|
405 | + $result = \sqlsrv_query($conn, $sql); |
|
406 | + } |
|
407 | + if ($result === false) { |
|
408 | + throw SqlsrvException::createFromPhpError(); |
|
409 | + } |
|
410 | + return $result; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | |
@@ -421,9 +421,9 @@ discard block |
||
421 | 421 | */ |
422 | 422 | function sqlsrv_rollback($conn): void |
423 | 423 | { |
424 | - error_clear_last(); |
|
425 | - $result = \sqlsrv_rollback($conn); |
|
426 | - if ($result === false) { |
|
427 | - throw SqlsrvException::createFromPhpError(); |
|
428 | - } |
|
424 | + error_clear_last(); |
|
425 | + $result = \sqlsrv_rollback($conn); |
|
426 | + if ($result === false) { |
|
427 | + throw SqlsrvException::createFromPhpError(); |
|
428 | + } |
|
429 | 429 | } |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function ssh2_auth_agent($session, string $username): void |
17 | 17 | { |
18 | - error_clear_last(); |
|
19 | - $result = \ssh2_auth_agent($session, $username); |
|
20 | - if ($result === false) { |
|
21 | - throw Ssh2Exception::createFromPhpError(); |
|
22 | - } |
|
18 | + error_clear_last(); |
|
19 | + $result = \ssh2_auth_agent($session, $username); |
|
20 | + if ($result === false) { |
|
21 | + throw Ssh2Exception::createFromPhpError(); |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
@@ -41,17 +41,17 @@ discard block |
||
41 | 41 | */ |
42 | 42 | function ssh2_auth_hostbased_file($session, string $username, string $hostname, string $pubkeyfile, string $privkeyfile, string $passphrase = null, string $local_username = null): void |
43 | 43 | { |
44 | - error_clear_last(); |
|
45 | - if ($local_username !== null) { |
|
46 | - $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile, $passphrase, $local_username); |
|
47 | - } elseif ($passphrase !== null) { |
|
48 | - $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile, $passphrase); |
|
49 | - } else { |
|
50 | - $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile); |
|
51 | - } |
|
52 | - if ($result === false) { |
|
53 | - throw Ssh2Exception::createFromPhpError(); |
|
54 | - } |
|
44 | + error_clear_last(); |
|
45 | + if ($local_username !== null) { |
|
46 | + $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile, $passphrase, $local_username); |
|
47 | + } elseif ($passphrase !== null) { |
|
48 | + $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile, $passphrase); |
|
49 | + } else { |
|
50 | + $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile); |
|
51 | + } |
|
52 | + if ($result === false) { |
|
53 | + throw Ssh2Exception::createFromPhpError(); |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | */ |
69 | 69 | function ssh2_auth_password($session, string $username, string $password): void |
70 | 70 | { |
71 | - error_clear_last(); |
|
72 | - $result = \ssh2_auth_password($session, $username, $password); |
|
73 | - if ($result === false) { |
|
74 | - throw Ssh2Exception::createFromPhpError(); |
|
75 | - } |
|
71 | + error_clear_last(); |
|
72 | + $result = \ssh2_auth_password($session, $username, $password); |
|
73 | + if ($result === false) { |
|
74 | + throw Ssh2Exception::createFromPhpError(); |
|
75 | + } |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | */ |
94 | 94 | function ssh2_auth_pubkey_file($session, string $username, string $pubkeyfile, string $privkeyfile, string $passphrase = null): void |
95 | 95 | { |
96 | - error_clear_last(); |
|
97 | - if ($passphrase !== null) { |
|
98 | - $result = \ssh2_auth_pubkey_file($session, $username, $pubkeyfile, $privkeyfile, $passphrase); |
|
99 | - } else { |
|
100 | - $result = \ssh2_auth_pubkey_file($session, $username, $pubkeyfile, $privkeyfile); |
|
101 | - } |
|
102 | - if ($result === false) { |
|
103 | - throw Ssh2Exception::createFromPhpError(); |
|
104 | - } |
|
96 | + error_clear_last(); |
|
97 | + if ($passphrase !== null) { |
|
98 | + $result = \ssh2_auth_pubkey_file($session, $username, $pubkeyfile, $privkeyfile, $passphrase); |
|
99 | + } else { |
|
100 | + $result = \ssh2_auth_pubkey_file($session, $username, $pubkeyfile, $privkeyfile); |
|
101 | + } |
|
102 | + if ($result === false) { |
|
103 | + throw Ssh2Exception::createFromPhpError(); |
|
104 | + } |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
@@ -306,18 +306,18 @@ discard block |
||
306 | 306 | */ |
307 | 307 | function ssh2_connect(string $host, int $port = 22, array $methods = null, array $callbacks = null) |
308 | 308 | { |
309 | - error_clear_last(); |
|
310 | - if ($callbacks !== null) { |
|
311 | - $result = \ssh2_connect($host, $port, $methods, $callbacks); |
|
312 | - } elseif ($methods !== null) { |
|
313 | - $result = \ssh2_connect($host, $port, $methods); |
|
314 | - } else { |
|
315 | - $result = \ssh2_connect($host, $port); |
|
316 | - } |
|
317 | - if ($result === false) { |
|
318 | - throw Ssh2Exception::createFromPhpError(); |
|
319 | - } |
|
320 | - return $result; |
|
309 | + error_clear_last(); |
|
310 | + if ($callbacks !== null) { |
|
311 | + $result = \ssh2_connect($host, $port, $methods, $callbacks); |
|
312 | + } elseif ($methods !== null) { |
|
313 | + $result = \ssh2_connect($host, $port, $methods); |
|
314 | + } else { |
|
315 | + $result = \ssh2_connect($host, $port); |
|
316 | + } |
|
317 | + if ($result === false) { |
|
318 | + throw Ssh2Exception::createFromPhpError(); |
|
319 | + } |
|
320 | + return $result; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | |
@@ -331,11 +331,11 @@ discard block |
||
331 | 331 | */ |
332 | 332 | function ssh2_disconnect($session): void |
333 | 333 | { |
334 | - error_clear_last(); |
|
335 | - $result = \ssh2_disconnect($session); |
|
336 | - if ($result === false) { |
|
337 | - throw Ssh2Exception::createFromPhpError(); |
|
338 | - } |
|
334 | + error_clear_last(); |
|
335 | + $result = \ssh2_disconnect($session); |
|
336 | + if ($result === false) { |
|
337 | + throw Ssh2Exception::createFromPhpError(); |
|
338 | + } |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | |
@@ -359,24 +359,24 @@ discard block |
||
359 | 359 | */ |
360 | 360 | function ssh2_exec($session, string $command, string $pty = null, array $env = null, int $width = 80, int $height = 25, int $width_height_type = SSH2_TERM_UNIT_CHARS) |
361 | 361 | { |
362 | - error_clear_last(); |
|
363 | - if ($width_height_type !== SSH2_TERM_UNIT_CHARS) { |
|
364 | - $result = \ssh2_exec($session, $command, $pty, $env, $width, $height, $width_height_type); |
|
365 | - } elseif ($height !== 25) { |
|
366 | - $result = \ssh2_exec($session, $command, $pty, $env, $width, $height); |
|
367 | - } elseif ($width !== 80) { |
|
368 | - $result = \ssh2_exec($session, $command, $pty, $env, $width); |
|
369 | - } elseif ($env !== null) { |
|
370 | - $result = \ssh2_exec($session, $command, $pty, $env); |
|
371 | - } elseif ($pty !== null) { |
|
372 | - $result = \ssh2_exec($session, $command, $pty); |
|
373 | - } else { |
|
374 | - $result = \ssh2_exec($session, $command); |
|
375 | - } |
|
376 | - if ($result === false) { |
|
377 | - throw Ssh2Exception::createFromPhpError(); |
|
378 | - } |
|
379 | - return $result; |
|
362 | + error_clear_last(); |
|
363 | + if ($width_height_type !== SSH2_TERM_UNIT_CHARS) { |
|
364 | + $result = \ssh2_exec($session, $command, $pty, $env, $width, $height, $width_height_type); |
|
365 | + } elseif ($height !== 25) { |
|
366 | + $result = \ssh2_exec($session, $command, $pty, $env, $width, $height); |
|
367 | + } elseif ($width !== 80) { |
|
368 | + $result = \ssh2_exec($session, $command, $pty, $env, $width); |
|
369 | + } elseif ($env !== null) { |
|
370 | + $result = \ssh2_exec($session, $command, $pty, $env); |
|
371 | + } elseif ($pty !== null) { |
|
372 | + $result = \ssh2_exec($session, $command, $pty); |
|
373 | + } else { |
|
374 | + $result = \ssh2_exec($session, $command); |
|
375 | + } |
|
376 | + if ($result === false) { |
|
377 | + throw Ssh2Exception::createFromPhpError(); |
|
378 | + } |
|
379 | + return $result; |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | |
@@ -397,15 +397,15 @@ discard block |
||
397 | 397 | */ |
398 | 398 | function ssh2_publickey_add($pkey, string $algoname, string $blob, bool $overwrite = false, array $attributes = null): void |
399 | 399 | { |
400 | - error_clear_last(); |
|
401 | - if ($attributes !== null) { |
|
402 | - $result = \ssh2_publickey_add($pkey, $algoname, $blob, $overwrite, $attributes); |
|
403 | - } else { |
|
404 | - $result = \ssh2_publickey_add($pkey, $algoname, $blob, $overwrite); |
|
405 | - } |
|
406 | - if ($result === false) { |
|
407 | - throw Ssh2Exception::createFromPhpError(); |
|
408 | - } |
|
400 | + error_clear_last(); |
|
401 | + if ($attributes !== null) { |
|
402 | + $result = \ssh2_publickey_add($pkey, $algoname, $blob, $overwrite, $attributes); |
|
403 | + } else { |
|
404 | + $result = \ssh2_publickey_add($pkey, $algoname, $blob, $overwrite); |
|
405 | + } |
|
406 | + if ($result === false) { |
|
407 | + throw Ssh2Exception::createFromPhpError(); |
|
408 | + } |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | |
@@ -426,12 +426,12 @@ discard block |
||
426 | 426 | */ |
427 | 427 | function ssh2_publickey_init($session) |
428 | 428 | { |
429 | - error_clear_last(); |
|
430 | - $result = \ssh2_publickey_init($session); |
|
431 | - if ($result === false) { |
|
432 | - throw Ssh2Exception::createFromPhpError(); |
|
433 | - } |
|
434 | - return $result; |
|
429 | + error_clear_last(); |
|
430 | + $result = \ssh2_publickey_init($session); |
|
431 | + if ($result === false) { |
|
432 | + throw Ssh2Exception::createFromPhpError(); |
|
433 | + } |
|
434 | + return $result; |
|
435 | 435 | } |
436 | 436 | |
437 | 437 | |
@@ -446,11 +446,11 @@ discard block |
||
446 | 446 | */ |
447 | 447 | function ssh2_publickey_remove($pkey, string $algoname, string $blob): void |
448 | 448 | { |
449 | - error_clear_last(); |
|
450 | - $result = \ssh2_publickey_remove($pkey, $algoname, $blob); |
|
451 | - if ($result === false) { |
|
452 | - throw Ssh2Exception::createFromPhpError(); |
|
453 | - } |
|
449 | + error_clear_last(); |
|
450 | + $result = \ssh2_publickey_remove($pkey, $algoname, $blob); |
|
451 | + if ($result === false) { |
|
452 | + throw Ssh2Exception::createFromPhpError(); |
|
453 | + } |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | |
@@ -466,11 +466,11 @@ discard block |
||
466 | 466 | */ |
467 | 467 | function ssh2_scp_recv($session, string $remote_file, string $local_file): void |
468 | 468 | { |
469 | - error_clear_last(); |
|
470 | - $result = \ssh2_scp_recv($session, $remote_file, $local_file); |
|
471 | - if ($result === false) { |
|
472 | - throw Ssh2Exception::createFromPhpError(); |
|
473 | - } |
|
469 | + error_clear_last(); |
|
470 | + $result = \ssh2_scp_recv($session, $remote_file, $local_file); |
|
471 | + if ($result === false) { |
|
472 | + throw Ssh2Exception::createFromPhpError(); |
|
473 | + } |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | |
@@ -488,11 +488,11 @@ discard block |
||
488 | 488 | */ |
489 | 489 | function ssh2_scp_send($session, string $local_file, string $remote_file, int $create_mode = 0644): void |
490 | 490 | { |
491 | - error_clear_last(); |
|
492 | - $result = \ssh2_scp_send($session, $local_file, $remote_file, $create_mode); |
|
493 | - if ($result === false) { |
|
494 | - throw Ssh2Exception::createFromPhpError(); |
|
495 | - } |
|
491 | + error_clear_last(); |
|
492 | + $result = \ssh2_scp_send($session, $local_file, $remote_file, $create_mode); |
|
493 | + if ($result === false) { |
|
494 | + throw Ssh2Exception::createFromPhpError(); |
|
495 | + } |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | |
@@ -508,11 +508,11 @@ discard block |
||
508 | 508 | */ |
509 | 509 | function ssh2_sftp_chmod($sftp, string $filename, int $mode): void |
510 | 510 | { |
511 | - error_clear_last(); |
|
512 | - $result = \ssh2_sftp_chmod($sftp, $filename, $mode); |
|
513 | - if ($result === false) { |
|
514 | - throw Ssh2Exception::createFromPhpError(); |
|
515 | - } |
|
511 | + error_clear_last(); |
|
512 | + $result = \ssh2_sftp_chmod($sftp, $filename, $mode); |
|
513 | + if ($result === false) { |
|
514 | + throw Ssh2Exception::createFromPhpError(); |
|
515 | + } |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | |
@@ -533,11 +533,11 @@ discard block |
||
533 | 533 | */ |
534 | 534 | function ssh2_sftp_mkdir($sftp, string $dirname, int $mode = 0777, bool $recursive = false): void |
535 | 535 | { |
536 | - error_clear_last(); |
|
537 | - $result = \ssh2_sftp_mkdir($sftp, $dirname, $mode, $recursive); |
|
538 | - if ($result === false) { |
|
539 | - throw Ssh2Exception::createFromPhpError(); |
|
540 | - } |
|
536 | + error_clear_last(); |
|
537 | + $result = \ssh2_sftp_mkdir($sftp, $dirname, $mode, $recursive); |
|
538 | + if ($result === false) { |
|
539 | + throw Ssh2Exception::createFromPhpError(); |
|
540 | + } |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | |
@@ -552,11 +552,11 @@ discard block |
||
552 | 552 | */ |
553 | 553 | function ssh2_sftp_rename($sftp, string $from, string $to): void |
554 | 554 | { |
555 | - error_clear_last(); |
|
556 | - $result = \ssh2_sftp_rename($sftp, $from, $to); |
|
557 | - if ($result === false) { |
|
558 | - throw Ssh2Exception::createFromPhpError(); |
|
559 | - } |
|
555 | + error_clear_last(); |
|
556 | + $result = \ssh2_sftp_rename($sftp, $from, $to); |
|
557 | + if ($result === false) { |
|
558 | + throw Ssh2Exception::createFromPhpError(); |
|
559 | + } |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | |
@@ -573,11 +573,11 @@ discard block |
||
573 | 573 | */ |
574 | 574 | function ssh2_sftp_rmdir($sftp, string $dirname): void |
575 | 575 | { |
576 | - error_clear_last(); |
|
577 | - $result = \ssh2_sftp_rmdir($sftp, $dirname); |
|
578 | - if ($result === false) { |
|
579 | - throw Ssh2Exception::createFromPhpError(); |
|
580 | - } |
|
576 | + error_clear_last(); |
|
577 | + $result = \ssh2_sftp_rmdir($sftp, $dirname); |
|
578 | + if ($result === false) { |
|
579 | + throw Ssh2Exception::createFromPhpError(); |
|
580 | + } |
|
581 | 581 | } |
582 | 582 | |
583 | 583 | |
@@ -593,11 +593,11 @@ discard block |
||
593 | 593 | */ |
594 | 594 | function ssh2_sftp_symlink($sftp, string $target, string $link): void |
595 | 595 | { |
596 | - error_clear_last(); |
|
597 | - $result = \ssh2_sftp_symlink($sftp, $target, $link); |
|
598 | - if ($result === false) { |
|
599 | - throw Ssh2Exception::createFromPhpError(); |
|
600 | - } |
|
596 | + error_clear_last(); |
|
597 | + $result = \ssh2_sftp_symlink($sftp, $target, $link); |
|
598 | + if ($result === false) { |
|
599 | + throw Ssh2Exception::createFromPhpError(); |
|
600 | + } |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | |
@@ -611,11 +611,11 @@ discard block |
||
611 | 611 | */ |
612 | 612 | function ssh2_sftp_unlink($sftp, string $filename): void |
613 | 613 | { |
614 | - error_clear_last(); |
|
615 | - $result = \ssh2_sftp_unlink($sftp, $filename); |
|
616 | - if ($result === false) { |
|
617 | - throw Ssh2Exception::createFromPhpError(); |
|
618 | - } |
|
614 | + error_clear_last(); |
|
615 | + $result = \ssh2_sftp_unlink($sftp, $filename); |
|
616 | + if ($result === false) { |
|
617 | + throw Ssh2Exception::createFromPhpError(); |
|
618 | + } |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | |
@@ -632,10 +632,10 @@ discard block |
||
632 | 632 | */ |
633 | 633 | function ssh2_sftp($session) |
634 | 634 | { |
635 | - error_clear_last(); |
|
636 | - $result = \ssh2_sftp($session); |
|
637 | - if ($result === false) { |
|
638 | - throw Ssh2Exception::createFromPhpError(); |
|
639 | - } |
|
640 | - return $result; |
|
635 | + error_clear_last(); |
|
636 | + $result = \ssh2_sftp($session); |
|
637 | + if ($result === false) { |
|
638 | + throw Ssh2Exception::createFromPhpError(); |
|
639 | + } |
|
640 | + return $result; |
|
641 | 641 | } |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | */ |
14 | 14 | function closelog(): void |
15 | 15 | { |
16 | - error_clear_last(); |
|
17 | - $result = \closelog(); |
|
18 | - if ($result === false) { |
|
19 | - throw NetworkException::createFromPhpError(); |
|
20 | - } |
|
16 | + error_clear_last(); |
|
17 | + $result = \closelog(); |
|
18 | + if ($result === false) { |
|
19 | + throw NetworkException::createFromPhpError(); |
|
20 | + } |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
@@ -247,12 +247,12 @@ discard block |
||
247 | 247 | */ |
248 | 248 | function dns_get_record(string $hostname, int $type = DNS_ANY, ?array &$authns = null, ?array &$addtl = null, bool $raw = false): array |
249 | 249 | { |
250 | - error_clear_last(); |
|
251 | - $result = \dns_get_record($hostname, $type, $authns, $addtl, $raw); |
|
252 | - if ($result === false) { |
|
253 | - throw NetworkException::createFromPhpError(); |
|
254 | - } |
|
255 | - return $result; |
|
250 | + error_clear_last(); |
|
251 | + $result = \dns_get_record($hostname, $type, $authns, $addtl, $raw); |
|
252 | + if ($result === false) { |
|
253 | + throw NetworkException::createFromPhpError(); |
|
254 | + } |
|
255 | + return $result; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | |
@@ -306,16 +306,16 @@ discard block |
||
306 | 306 | */ |
307 | 307 | function fsockopen(string $hostname, int $port = -1, ?int &$errno = null, ?string &$errstr = null, float $timeout = null) |
308 | 308 | { |
309 | - error_clear_last(); |
|
310 | - if ($timeout !== null) { |
|
311 | - $result = \fsockopen($hostname, $port, $errno, $errstr, $timeout); |
|
312 | - } else { |
|
313 | - $result = \fsockopen($hostname, $port, $errno, $errstr); |
|
314 | - } |
|
315 | - if ($result === false) { |
|
316 | - throw NetworkException::createFromPhpError(); |
|
317 | - } |
|
318 | - return $result; |
|
309 | + error_clear_last(); |
|
310 | + if ($timeout !== null) { |
|
311 | + $result = \fsockopen($hostname, $port, $errno, $errstr, $timeout); |
|
312 | + } else { |
|
313 | + $result = \fsockopen($hostname, $port, $errno, $errstr); |
|
314 | + } |
|
315 | + if ($result === false) { |
|
316 | + throw NetworkException::createFromPhpError(); |
|
317 | + } |
|
318 | + return $result; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | |
@@ -330,12 +330,12 @@ discard block |
||
330 | 330 | */ |
331 | 331 | function gethostname(): string |
332 | 332 | { |
333 | - error_clear_last(); |
|
334 | - $result = \gethostname(); |
|
335 | - if ($result === false) { |
|
336 | - throw NetworkException::createFromPhpError(); |
|
337 | - } |
|
338 | - return $result; |
|
333 | + error_clear_last(); |
|
334 | + $result = \gethostname(); |
|
335 | + if ($result === false) { |
|
336 | + throw NetworkException::createFromPhpError(); |
|
337 | + } |
|
338 | + return $result; |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | |
@@ -351,12 +351,12 @@ discard block |
||
351 | 351 | */ |
352 | 352 | function getprotobyname(string $name): int |
353 | 353 | { |
354 | - error_clear_last(); |
|
355 | - $result = \getprotobyname($name); |
|
356 | - if ($result === false) { |
|
357 | - throw NetworkException::createFromPhpError(); |
|
358 | - } |
|
359 | - return $result; |
|
354 | + error_clear_last(); |
|
355 | + $result = \getprotobyname($name); |
|
356 | + if ($result === false) { |
|
357 | + throw NetworkException::createFromPhpError(); |
|
358 | + } |
|
359 | + return $result; |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | |
@@ -372,12 +372,12 @@ discard block |
||
372 | 372 | */ |
373 | 373 | function getprotobynumber(int $number): string |
374 | 374 | { |
375 | - error_clear_last(); |
|
376 | - $result = \getprotobynumber($number); |
|
377 | - if ($result === false) { |
|
378 | - throw NetworkException::createFromPhpError(); |
|
379 | - } |
|
380 | - return $result; |
|
375 | + error_clear_last(); |
|
376 | + $result = \getprotobynumber($number); |
|
377 | + if ($result === false) { |
|
378 | + throw NetworkException::createFromPhpError(); |
|
379 | + } |
|
380 | + return $result; |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | |
@@ -395,11 +395,11 @@ discard block |
||
395 | 395 | */ |
396 | 396 | function header_register_callback(callable $callback): void |
397 | 397 | { |
398 | - error_clear_last(); |
|
399 | - $result = \header_register_callback($callback); |
|
400 | - if ($result === false) { |
|
401 | - throw NetworkException::createFromPhpError(); |
|
402 | - } |
|
398 | + error_clear_last(); |
|
399 | + $result = \header_register_callback($callback); |
|
400 | + if ($result === false) { |
|
401 | + throw NetworkException::createFromPhpError(); |
|
402 | + } |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | |
@@ -413,12 +413,12 @@ discard block |
||
413 | 413 | */ |
414 | 414 | function inet_ntop(string $in_addr): string |
415 | 415 | { |
416 | - error_clear_last(); |
|
417 | - $result = \inet_ntop($in_addr); |
|
418 | - if ($result === false) { |
|
419 | - throw NetworkException::createFromPhpError(); |
|
420 | - } |
|
421 | - return $result; |
|
416 | + error_clear_last(); |
|
417 | + $result = \inet_ntop($in_addr); |
|
418 | + if ($result === false) { |
|
419 | + throw NetworkException::createFromPhpError(); |
|
420 | + } |
|
421 | + return $result; |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | |
@@ -556,11 +556,11 @@ discard block |
||
556 | 556 | */ |
557 | 557 | function openlog(string $ident, int $option, int $facility): void |
558 | 558 | { |
559 | - error_clear_last(); |
|
560 | - $result = \openlog($ident, $option, $facility); |
|
561 | - if ($result === false) { |
|
562 | - throw NetworkException::createFromPhpError(); |
|
563 | - } |
|
559 | + error_clear_last(); |
|
560 | + $result = \openlog($ident, $option, $facility); |
|
561 | + if ($result === false) { |
|
562 | + throw NetworkException::createFromPhpError(); |
|
563 | + } |
|
564 | 564 | } |
565 | 565 | |
566 | 566 | |
@@ -631,9 +631,9 @@ discard block |
||
631 | 631 | */ |
632 | 632 | function syslog(int $priority, string $message): void |
633 | 633 | { |
634 | - error_clear_last(); |
|
635 | - $result = \syslog($priority, $message); |
|
636 | - if ($result === false) { |
|
637 | - throw NetworkException::createFromPhpError(); |
|
638 | - } |
|
634 | + error_clear_last(); |
|
635 | + $result = \syslog($priority, $message); |
|
636 | + if ($result === false) { |
|
637 | + throw NetworkException::createFromPhpError(); |
|
638 | + } |
|
639 | 639 | } |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function msql_affected_rows($result): int |
19 | 19 | { |
20 | - error_clear_last(); |
|
21 | - $result = \msql_affected_rows($result); |
|
22 | - if ($result === false) { |
|
23 | - throw MsqlException::createFromPhpError(); |
|
24 | - } |
|
25 | - return $result; |
|
20 | + error_clear_last(); |
|
21 | + $result = \msql_affected_rows($result); |
|
22 | + if ($result === false) { |
|
23 | + throw MsqlException::createFromPhpError(); |
|
24 | + } |
|
25 | + return $result; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | */ |
44 | 44 | function msql_close($link_identifier = null): void |
45 | 45 | { |
46 | - error_clear_last(); |
|
47 | - if ($link_identifier !== null) { |
|
48 | - $result = \msql_close($link_identifier); |
|
49 | - } else { |
|
50 | - $result = \msql_close(); |
|
51 | - } |
|
52 | - if ($result === false) { |
|
53 | - throw MsqlException::createFromPhpError(); |
|
54 | - } |
|
46 | + error_clear_last(); |
|
47 | + if ($link_identifier !== null) { |
|
48 | + $result = \msql_close($link_identifier); |
|
49 | + } else { |
|
50 | + $result = \msql_close(); |
|
51 | + } |
|
52 | + if ($result === false) { |
|
53 | + throw MsqlException::createFromPhpError(); |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -83,16 +83,16 @@ discard block |
||
83 | 83 | */ |
84 | 84 | function msql_connect(string $hostname = null) |
85 | 85 | { |
86 | - error_clear_last(); |
|
87 | - if ($hostname !== null) { |
|
88 | - $result = \msql_connect($hostname); |
|
89 | - } else { |
|
90 | - $result = \msql_connect(); |
|
91 | - } |
|
92 | - if ($result === false) { |
|
93 | - throw MsqlException::createFromPhpError(); |
|
94 | - } |
|
95 | - return $result; |
|
86 | + error_clear_last(); |
|
87 | + if ($hostname !== null) { |
|
88 | + $result = \msql_connect($hostname); |
|
89 | + } else { |
|
90 | + $result = \msql_connect(); |
|
91 | + } |
|
92 | + if ($result === false) { |
|
93 | + throw MsqlException::createFromPhpError(); |
|
94 | + } |
|
95 | + return $result; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -110,15 +110,15 @@ discard block |
||
110 | 110 | */ |
111 | 111 | function msql_create_db(string $database_name, $link_identifier = null): void |
112 | 112 | { |
113 | - error_clear_last(); |
|
114 | - if ($link_identifier !== null) { |
|
115 | - $result = \msql_create_db($database_name, $link_identifier); |
|
116 | - } else { |
|
117 | - $result = \msql_create_db($database_name); |
|
118 | - } |
|
119 | - if ($result === false) { |
|
120 | - throw MsqlException::createFromPhpError(); |
|
121 | - } |
|
113 | + error_clear_last(); |
|
114 | + if ($link_identifier !== null) { |
|
115 | + $result = \msql_create_db($database_name, $link_identifier); |
|
116 | + } else { |
|
117 | + $result = \msql_create_db($database_name); |
|
118 | + } |
|
119 | + if ($result === false) { |
|
120 | + throw MsqlException::createFromPhpError(); |
|
121 | + } |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | */ |
139 | 139 | function msql_data_seek($result, int $row_number): void |
140 | 140 | { |
141 | - error_clear_last(); |
|
142 | - $result = \msql_data_seek($result, $row_number); |
|
143 | - if ($result === false) { |
|
144 | - throw MsqlException::createFromPhpError(); |
|
145 | - } |
|
141 | + error_clear_last(); |
|
142 | + $result = \msql_data_seek($result, $row_number); |
|
143 | + if ($result === false) { |
|
144 | + throw MsqlException::createFromPhpError(); |
|
145 | + } |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | |
@@ -162,16 +162,16 @@ discard block |
||
162 | 162 | */ |
163 | 163 | function msql_db_query(string $database, string $query, $link_identifier = null) |
164 | 164 | { |
165 | - error_clear_last(); |
|
166 | - if ($link_identifier !== null) { |
|
167 | - $result = \msql_db_query($database, $query, $link_identifier); |
|
168 | - } else { |
|
169 | - $result = \msql_db_query($database, $query); |
|
170 | - } |
|
171 | - if ($result === false) { |
|
172 | - throw MsqlException::createFromPhpError(); |
|
173 | - } |
|
174 | - return $result; |
|
165 | + error_clear_last(); |
|
166 | + if ($link_identifier !== null) { |
|
167 | + $result = \msql_db_query($database, $query, $link_identifier); |
|
168 | + } else { |
|
169 | + $result = \msql_db_query($database, $query); |
|
170 | + } |
|
171 | + if ($result === false) { |
|
172 | + throw MsqlException::createFromPhpError(); |
|
173 | + } |
|
174 | + return $result; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | |
@@ -189,15 +189,15 @@ discard block |
||
189 | 189 | */ |
190 | 190 | function msql_drop_db(string $database_name, $link_identifier = null): void |
191 | 191 | { |
192 | - error_clear_last(); |
|
193 | - if ($link_identifier !== null) { |
|
194 | - $result = \msql_drop_db($database_name, $link_identifier); |
|
195 | - } else { |
|
196 | - $result = \msql_drop_db($database_name); |
|
197 | - } |
|
198 | - if ($result === false) { |
|
199 | - throw MsqlException::createFromPhpError(); |
|
200 | - } |
|
192 | + error_clear_last(); |
|
193 | + if ($link_identifier !== null) { |
|
194 | + $result = \msql_drop_db($database_name, $link_identifier); |
|
195 | + } else { |
|
196 | + $result = \msql_drop_db($database_name); |
|
197 | + } |
|
198 | + if ($result === false) { |
|
199 | + throw MsqlException::createFromPhpError(); |
|
200 | + } |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -216,12 +216,12 @@ discard block |
||
216 | 216 | */ |
217 | 217 | function msql_field_len($result, int $field_offset): int |
218 | 218 | { |
219 | - error_clear_last(); |
|
220 | - $result = \msql_field_len($result, $field_offset); |
|
221 | - if ($result === false) { |
|
222 | - throw MsqlException::createFromPhpError(); |
|
223 | - } |
|
224 | - return $result; |
|
219 | + error_clear_last(); |
|
220 | + $result = \msql_field_len($result, $field_offset); |
|
221 | + if ($result === false) { |
|
222 | + throw MsqlException::createFromPhpError(); |
|
223 | + } |
|
224 | + return $result; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | |
@@ -240,12 +240,12 @@ discard block |
||
240 | 240 | */ |
241 | 241 | function msql_field_name($result, int $field_offset): string |
242 | 242 | { |
243 | - error_clear_last(); |
|
244 | - $result = \msql_field_name($result, $field_offset); |
|
245 | - if ($result === false) { |
|
246 | - throw MsqlException::createFromPhpError(); |
|
247 | - } |
|
248 | - return $result; |
|
243 | + error_clear_last(); |
|
244 | + $result = \msql_field_name($result, $field_offset); |
|
245 | + if ($result === false) { |
|
246 | + throw MsqlException::createFromPhpError(); |
|
247 | + } |
|
248 | + return $result; |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -264,11 +264,11 @@ discard block |
||
264 | 264 | */ |
265 | 265 | function msql_field_seek($result, int $field_offset): void |
266 | 266 | { |
267 | - error_clear_last(); |
|
268 | - $result = \msql_field_seek($result, $field_offset); |
|
269 | - if ($result === false) { |
|
270 | - throw MsqlException::createFromPhpError(); |
|
271 | - } |
|
267 | + error_clear_last(); |
|
268 | + $result = \msql_field_seek($result, $field_offset); |
|
269 | + if ($result === false) { |
|
270 | + throw MsqlException::createFromPhpError(); |
|
271 | + } |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | |
@@ -286,12 +286,12 @@ discard block |
||
286 | 286 | */ |
287 | 287 | function msql_field_table($result, int $field_offset): int |
288 | 288 | { |
289 | - error_clear_last(); |
|
290 | - $result = \msql_field_table($result, $field_offset); |
|
291 | - if ($result === false) { |
|
292 | - throw MsqlException::createFromPhpError(); |
|
293 | - } |
|
294 | - return $result; |
|
289 | + error_clear_last(); |
|
290 | + $result = \msql_field_table($result, $field_offset); |
|
291 | + if ($result === false) { |
|
292 | + throw MsqlException::createFromPhpError(); |
|
293 | + } |
|
294 | + return $result; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | |
@@ -313,12 +313,12 @@ discard block |
||
313 | 313 | */ |
314 | 314 | function msql_field_type($result, int $field_offset): string |
315 | 315 | { |
316 | - error_clear_last(); |
|
317 | - $result = \msql_field_type($result, $field_offset); |
|
318 | - if ($result === false) { |
|
319 | - throw MsqlException::createFromPhpError(); |
|
320 | - } |
|
321 | - return $result; |
|
316 | + error_clear_last(); |
|
317 | + $result = \msql_field_type($result, $field_offset); |
|
318 | + if ($result === false) { |
|
319 | + throw MsqlException::createFromPhpError(); |
|
320 | + } |
|
321 | + return $result; |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
@@ -337,11 +337,11 @@ discard block |
||
337 | 337 | */ |
338 | 338 | function msql_free_result($result): void |
339 | 339 | { |
340 | - error_clear_last(); |
|
341 | - $result = \msql_free_result($result); |
|
342 | - if ($result === false) { |
|
343 | - throw MsqlException::createFromPhpError(); |
|
344 | - } |
|
340 | + error_clear_last(); |
|
341 | + $result = \msql_free_result($result); |
|
342 | + if ($result === false) { |
|
343 | + throw MsqlException::createFromPhpError(); |
|
344 | + } |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | |
@@ -371,16 +371,16 @@ discard block |
||
371 | 371 | */ |
372 | 372 | function msql_pconnect(string $hostname = null) |
373 | 373 | { |
374 | - error_clear_last(); |
|
375 | - if ($hostname !== null) { |
|
376 | - $result = \msql_pconnect($hostname); |
|
377 | - } else { |
|
378 | - $result = \msql_pconnect(); |
|
379 | - } |
|
380 | - if ($result === false) { |
|
381 | - throw MsqlException::createFromPhpError(); |
|
382 | - } |
|
383 | - return $result; |
|
374 | + error_clear_last(); |
|
375 | + if ($hostname !== null) { |
|
376 | + $result = \msql_pconnect($hostname); |
|
377 | + } else { |
|
378 | + $result = \msql_pconnect(); |
|
379 | + } |
|
380 | + if ($result === false) { |
|
381 | + throw MsqlException::createFromPhpError(); |
|
382 | + } |
|
383 | + return $result; |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | |
@@ -400,16 +400,16 @@ discard block |
||
400 | 400 | */ |
401 | 401 | function msql_query(string $query, $link_identifier = null) |
402 | 402 | { |
403 | - error_clear_last(); |
|
404 | - if ($link_identifier !== null) { |
|
405 | - $result = \msql_query($query, $link_identifier); |
|
406 | - } else { |
|
407 | - $result = \msql_query($query); |
|
408 | - } |
|
409 | - if ($result === false) { |
|
410 | - throw MsqlException::createFromPhpError(); |
|
411 | - } |
|
412 | - return $result; |
|
403 | + error_clear_last(); |
|
404 | + if ($link_identifier !== null) { |
|
405 | + $result = \msql_query($query, $link_identifier); |
|
406 | + } else { |
|
407 | + $result = \msql_query($query); |
|
408 | + } |
|
409 | + if ($result === false) { |
|
410 | + throw MsqlException::createFromPhpError(); |
|
411 | + } |
|
412 | + return $result; |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | |
@@ -431,13 +431,13 @@ discard block |
||
431 | 431 | */ |
432 | 432 | function msql_select_db(string $database_name, $link_identifier = null): void |
433 | 433 | { |
434 | - error_clear_last(); |
|
435 | - if ($link_identifier !== null) { |
|
436 | - $result = \msql_select_db($database_name, $link_identifier); |
|
437 | - } else { |
|
438 | - $result = \msql_select_db($database_name); |
|
439 | - } |
|
440 | - if ($result === false) { |
|
441 | - throw MsqlException::createFromPhpError(); |
|
442 | - } |
|
434 | + error_clear_last(); |
|
435 | + if ($link_identifier !== null) { |
|
436 | + $result = \msql_select_db($database_name, $link_identifier); |
|
437 | + } else { |
|
438 | + $result = \msql_select_db($database_name); |
|
439 | + } |
|
440 | + if ($result === false) { |
|
441 | + throw MsqlException::createFromPhpError(); |
|
442 | + } |
|
443 | 443 | } |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | */ |
19 | 19 | function ssdeep_fuzzy_compare(string $signature1, string $signature2): int |
20 | 20 | { |
21 | - error_clear_last(); |
|
22 | - $result = \ssdeep_fuzzy_compare($signature1, $signature2); |
|
23 | - if ($result === false) { |
|
24 | - throw SsdeepException::createFromPhpError(); |
|
25 | - } |
|
26 | - return $result; |
|
21 | + error_clear_last(); |
|
22 | + $result = \ssdeep_fuzzy_compare($signature1, $signature2); |
|
23 | + if ($result === false) { |
|
24 | + throw SsdeepException::createFromPhpError(); |
|
25 | + } |
|
26 | + return $result; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | */ |
41 | 41 | function ssdeep_fuzzy_hash_filename(string $file_name): string |
42 | 42 | { |
43 | - error_clear_last(); |
|
44 | - $result = \ssdeep_fuzzy_hash_filename($file_name); |
|
45 | - if ($result === false) { |
|
46 | - throw SsdeepException::createFromPhpError(); |
|
47 | - } |
|
48 | - return $result; |
|
43 | + error_clear_last(); |
|
44 | + $result = \ssdeep_fuzzy_hash_filename($file_name); |
|
45 | + if ($result === false) { |
|
46 | + throw SsdeepException::createFromPhpError(); |
|
47 | + } |
|
48 | + return $result; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function ssdeep_fuzzy_hash(string $to_hash): string |
63 | 63 | { |
64 | - error_clear_last(); |
|
65 | - $result = \ssdeep_fuzzy_hash($to_hash); |
|
66 | - if ($result === false) { |
|
67 | - throw SsdeepException::createFromPhpError(); |
|
68 | - } |
|
69 | - return $result; |
|
64 | + error_clear_last(); |
|
65 | + $result = \ssdeep_fuzzy_hash($to_hash); |
|
66 | + if ($result === false) { |
|
67 | + throw SsdeepException::createFromPhpError(); |
|
68 | + } |
|
69 | + return $result; |
|
70 | 70 | } |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | */ |
22 | 22 | function ob_end_clean(): void |
23 | 23 | { |
24 | - error_clear_last(); |
|
25 | - $result = \ob_end_clean(); |
|
26 | - if ($result === false) { |
|
27 | - throw OutcontrolException::createFromPhpError(); |
|
28 | - } |
|
24 | + error_clear_last(); |
|
25 | + $result = \ob_end_clean(); |
|
26 | + if ($result === false) { |
|
27 | + throw OutcontrolException::createFromPhpError(); |
|
28 | + } |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | function ob_end_flush(): void |
49 | 49 | { |
50 | - error_clear_last(); |
|
51 | - $result = \ob_end_flush(); |
|
52 | - if ($result === false) { |
|
53 | - throw OutcontrolException::createFromPhpError(); |
|
54 | - } |
|
50 | + error_clear_last(); |
|
51 | + $result = \ob_end_flush(); |
|
52 | + if ($result === false) { |
|
53 | + throw OutcontrolException::createFromPhpError(); |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | */ |
75 | 75 | function output_add_rewrite_var(string $name, string $value): void |
76 | 76 | { |
77 | - error_clear_last(); |
|
78 | - $result = \output_add_rewrite_var($name, $value); |
|
79 | - if ($result === false) { |
|
80 | - throw OutcontrolException::createFromPhpError(); |
|
81 | - } |
|
77 | + error_clear_last(); |
|
78 | + $result = \output_add_rewrite_var($name, $value); |
|
79 | + if ($result === false) { |
|
80 | + throw OutcontrolException::createFromPhpError(); |
|
81 | + } |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | */ |
93 | 93 | function output_reset_rewrite_vars(): void |
94 | 94 | { |
95 | - error_clear_last(); |
|
96 | - $result = \output_reset_rewrite_vars(); |
|
97 | - if ($result === false) { |
|
98 | - throw OutcontrolException::createFromPhpError(); |
|
99 | - } |
|
95 | + error_clear_last(); |
|
96 | + $result = \output_reset_rewrite_vars(); |
|
97 | + if ($result === false) { |
|
98 | + throw OutcontrolException::createFromPhpError(); |
|
99 | + } |
|
100 | 100 | } |
@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function mb_chr(int $cp, string $encoding = null): string |
17 | 17 | { |
18 | - error_clear_last(); |
|
19 | - if ($encoding !== null) { |
|
20 | - $result = \mb_chr($cp, $encoding); |
|
21 | - } else { |
|
22 | - $result = \mb_chr($cp); |
|
23 | - } |
|
24 | - if ($result === false) { |
|
25 | - throw MbstringException::createFromPhpError(); |
|
26 | - } |
|
27 | - return $result; |
|
18 | + error_clear_last(); |
|
19 | + if ($encoding !== null) { |
|
20 | + $result = \mb_chr($cp, $encoding); |
|
21 | + } else { |
|
22 | + $result = \mb_chr($cp); |
|
23 | + } |
|
24 | + if ($result === false) { |
|
25 | + throw MbstringException::createFromPhpError(); |
|
26 | + } |
|
27 | + return $result; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | */ |
60 | 60 | function mb_detect_order($encoding_list = null) |
61 | 61 | { |
62 | - error_clear_last(); |
|
63 | - if ($encoding_list !== null) { |
|
64 | - $result = \mb_detect_order($encoding_list); |
|
65 | - } else { |
|
66 | - $result = \mb_detect_order(); |
|
67 | - } |
|
68 | - if ($result === false) { |
|
69 | - throw MbstringException::createFromPhpError(); |
|
70 | - } |
|
71 | - return $result; |
|
62 | + error_clear_last(); |
|
63 | + if ($encoding_list !== null) { |
|
64 | + $result = \mb_detect_order($encoding_list); |
|
65 | + } else { |
|
66 | + $result = \mb_detect_order(); |
|
67 | + } |
|
68 | + if ($result === false) { |
|
69 | + throw MbstringException::createFromPhpError(); |
|
70 | + } |
|
71 | + return $result; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | */ |
83 | 83 | function mb_encoding_aliases(string $encoding): array |
84 | 84 | { |
85 | - error_clear_last(); |
|
86 | - $result = \mb_encoding_aliases($encoding); |
|
87 | - if ($result === false) { |
|
88 | - throw MbstringException::createFromPhpError(); |
|
89 | - } |
|
90 | - return $result; |
|
85 | + error_clear_last(); |
|
86 | + $result = \mb_encoding_aliases($encoding); |
|
87 | + if ($result === false) { |
|
88 | + throw MbstringException::createFromPhpError(); |
|
89 | + } |
|
90 | + return $result; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | */ |
126 | 126 | function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, string $option = "msr"): string |
127 | 127 | { |
128 | - error_clear_last(); |
|
129 | - $result = \mb_ereg_replace_callback($pattern, $callback, $string, $option); |
|
130 | - if ($result === false) { |
|
131 | - throw MbstringException::createFromPhpError(); |
|
132 | - } |
|
133 | - return $result; |
|
128 | + error_clear_last(); |
|
129 | + $result = \mb_ereg_replace_callback($pattern, $callback, $string, $option); |
|
130 | + if ($result === false) { |
|
131 | + throw MbstringException::createFromPhpError(); |
|
132 | + } |
|
133 | + return $result; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | */ |
150 | 150 | function mb_ereg_replace(string $pattern, string $replacement, string $string, string $option = "msr"): string |
151 | 151 | { |
152 | - error_clear_last(); |
|
153 | - $result = \mb_ereg_replace($pattern, $replacement, $string, $option); |
|
154 | - if ($result === false) { |
|
155 | - throw MbstringException::createFromPhpError(); |
|
156 | - } |
|
157 | - return $result; |
|
152 | + error_clear_last(); |
|
153 | + $result = \mb_ereg_replace($pattern, $replacement, $string, $option); |
|
154 | + if ($result === false) { |
|
155 | + throw MbstringException::createFromPhpError(); |
|
156 | + } |
|
157 | + return $result; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | */ |
168 | 168 | function mb_ereg_search_getregs(): array |
169 | 169 | { |
170 | - error_clear_last(); |
|
171 | - $result = \mb_ereg_search_getregs(); |
|
172 | - if ($result === false) { |
|
173 | - throw MbstringException::createFromPhpError(); |
|
174 | - } |
|
175 | - return $result; |
|
170 | + error_clear_last(); |
|
171 | + $result = \mb_ereg_search_getregs(); |
|
172 | + if ($result === false) { |
|
173 | + throw MbstringException::createFromPhpError(); |
|
174 | + } |
|
175 | + return $result; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -192,17 +192,17 @@ discard block |
||
192 | 192 | */ |
193 | 193 | function mb_ereg_search_init(string $string, string $pattern = null, string $option = "msr"): void |
194 | 194 | { |
195 | - error_clear_last(); |
|
196 | - if ($option !== "msr") { |
|
197 | - $result = \mb_ereg_search_init($string, $pattern, $option); |
|
198 | - } elseif ($pattern !== null) { |
|
199 | - $result = \mb_ereg_search_init($string, $pattern); |
|
200 | - } else { |
|
201 | - $result = \mb_ereg_search_init($string); |
|
202 | - } |
|
203 | - if ($result === false) { |
|
204 | - throw MbstringException::createFromPhpError(); |
|
205 | - } |
|
195 | + error_clear_last(); |
|
196 | + if ($option !== "msr") { |
|
197 | + $result = \mb_ereg_search_init($string, $pattern, $option); |
|
198 | + } elseif ($pattern !== null) { |
|
199 | + $result = \mb_ereg_search_init($string, $pattern); |
|
200 | + } else { |
|
201 | + $result = \mb_ereg_search_init($string); |
|
202 | + } |
|
203 | + if ($result === false) { |
|
204 | + throw MbstringException::createFromPhpError(); |
|
205 | + } |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -217,18 +217,18 @@ discard block |
||
217 | 217 | */ |
218 | 218 | function mb_ereg_search_regs(string $pattern = null, string $option = "ms"): array |
219 | 219 | { |
220 | - error_clear_last(); |
|
221 | - if ($option !== "ms") { |
|
222 | - $result = \mb_ereg_search_regs($pattern, $option); |
|
223 | - } elseif ($pattern !== null) { |
|
224 | - $result = \mb_ereg_search_regs($pattern); |
|
225 | - } else { |
|
226 | - $result = \mb_ereg_search_regs(); |
|
227 | - } |
|
228 | - if ($result === false) { |
|
229 | - throw MbstringException::createFromPhpError(); |
|
230 | - } |
|
231 | - return $result; |
|
220 | + error_clear_last(); |
|
221 | + if ($option !== "ms") { |
|
222 | + $result = \mb_ereg_search_regs($pattern, $option); |
|
223 | + } elseif ($pattern !== null) { |
|
224 | + $result = \mb_ereg_search_regs($pattern); |
|
225 | + } else { |
|
226 | + $result = \mb_ereg_search_regs(); |
|
227 | + } |
|
228 | + if ($result === false) { |
|
229 | + throw MbstringException::createFromPhpError(); |
|
230 | + } |
|
231 | + return $result; |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | */ |
242 | 242 | function mb_ereg_search_setpos(int $position): void |
243 | 243 | { |
244 | - error_clear_last(); |
|
245 | - $result = \mb_ereg_search_setpos($position); |
|
246 | - if ($result === false) { |
|
247 | - throw MbstringException::createFromPhpError(); |
|
248 | - } |
|
244 | + error_clear_last(); |
|
245 | + $result = \mb_ereg_search_setpos($position); |
|
246 | + if ($result === false) { |
|
247 | + throw MbstringException::createFromPhpError(); |
|
248 | + } |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -262,12 +262,12 @@ discard block |
||
262 | 262 | */ |
263 | 263 | function mb_eregi_replace(string $pattern, string $replace, string $string, string $option = "msri"): string |
264 | 264 | { |
265 | - error_clear_last(); |
|
266 | - $result = \mb_eregi_replace($pattern, $replace, $string, $option); |
|
267 | - if ($result === false) { |
|
268 | - throw MbstringException::createFromPhpError(); |
|
269 | - } |
|
270 | - return $result; |
|
265 | + error_clear_last(); |
|
266 | + $result = \mb_eregi_replace($pattern, $replace, $string, $option); |
|
267 | + if ($result === false) { |
|
268 | + throw MbstringException::createFromPhpError(); |
|
269 | + } |
|
270 | + return $result; |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | |
@@ -291,16 +291,16 @@ discard block |
||
291 | 291 | */ |
292 | 292 | function mb_http_output(string $encoding = null) |
293 | 293 | { |
294 | - error_clear_last(); |
|
295 | - if ($encoding !== null) { |
|
296 | - $result = \mb_http_output($encoding); |
|
297 | - } else { |
|
298 | - $result = \mb_http_output(); |
|
299 | - } |
|
300 | - if ($result === false) { |
|
301 | - throw MbstringException::createFromPhpError(); |
|
302 | - } |
|
303 | - return $result; |
|
294 | + error_clear_last(); |
|
295 | + if ($encoding !== null) { |
|
296 | + $result = \mb_http_output($encoding); |
|
297 | + } else { |
|
298 | + $result = \mb_http_output(); |
|
299 | + } |
|
300 | + if ($result === false) { |
|
301 | + throw MbstringException::createFromPhpError(); |
|
302 | + } |
|
303 | + return $result; |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | |
@@ -322,16 +322,16 @@ discard block |
||
322 | 322 | */ |
323 | 323 | function mb_internal_encoding(string $encoding = null) |
324 | 324 | { |
325 | - error_clear_last(); |
|
326 | - if ($encoding !== null) { |
|
327 | - $result = \mb_internal_encoding($encoding); |
|
328 | - } else { |
|
329 | - $result = \mb_internal_encoding(); |
|
330 | - } |
|
331 | - if ($result === false) { |
|
332 | - throw MbstringException::createFromPhpError(); |
|
333 | - } |
|
334 | - return $result; |
|
325 | + error_clear_last(); |
|
326 | + if ($encoding !== null) { |
|
327 | + $result = \mb_internal_encoding($encoding); |
|
328 | + } else { |
|
329 | + $result = \mb_internal_encoding(); |
|
330 | + } |
|
331 | + if ($result === false) { |
|
332 | + throw MbstringException::createFromPhpError(); |
|
333 | + } |
|
334 | + return $result; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | |
@@ -346,16 +346,16 @@ discard block |
||
346 | 346 | */ |
347 | 347 | function mb_ord(string $str, string $encoding = null): int |
348 | 348 | { |
349 | - error_clear_last(); |
|
350 | - if ($encoding !== null) { |
|
351 | - $result = \mb_ord($str, $encoding); |
|
352 | - } else { |
|
353 | - $result = \mb_ord($str); |
|
354 | - } |
|
355 | - if ($result === false) { |
|
356 | - throw MbstringException::createFromPhpError(); |
|
357 | - } |
|
358 | - return $result; |
|
349 | + error_clear_last(); |
|
350 | + if ($encoding !== null) { |
|
351 | + $result = \mb_ord($str, $encoding); |
|
352 | + } else { |
|
353 | + $result = \mb_ord($str); |
|
354 | + } |
|
355 | + if ($result === false) { |
|
356 | + throw MbstringException::createFromPhpError(); |
|
357 | + } |
|
358 | + return $result; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | |
@@ -374,11 +374,11 @@ discard block |
||
374 | 374 | */ |
375 | 375 | function mb_parse_str(string $encoded_string, ?array &$result): void |
376 | 376 | { |
377 | - error_clear_last(); |
|
378 | - $result = \mb_parse_str($encoded_string, $result); |
|
379 | - if ($result === false) { |
|
380 | - throw MbstringException::createFromPhpError(); |
|
381 | - } |
|
377 | + error_clear_last(); |
|
378 | + $result = \mb_parse_str($encoded_string, $result); |
|
379 | + if ($result === false) { |
|
380 | + throw MbstringException::createFromPhpError(); |
|
381 | + } |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | |
@@ -394,16 +394,16 @@ discard block |
||
394 | 394 | */ |
395 | 395 | function mb_regex_encoding(string $encoding = null) |
396 | 396 | { |
397 | - error_clear_last(); |
|
398 | - if ($encoding !== null) { |
|
399 | - $result = \mb_regex_encoding($encoding); |
|
400 | - } else { |
|
401 | - $result = \mb_regex_encoding(); |
|
402 | - } |
|
403 | - if ($result === false) { |
|
404 | - throw MbstringException::createFromPhpError(); |
|
405 | - } |
|
406 | - return $result; |
|
397 | + error_clear_last(); |
|
398 | + if ($encoding !== null) { |
|
399 | + $result = \mb_regex_encoding($encoding); |
|
400 | + } else { |
|
401 | + $result = \mb_regex_encoding(); |
|
402 | + } |
|
403 | + if ($result === false) { |
|
404 | + throw MbstringException::createFromPhpError(); |
|
405 | + } |
|
406 | + return $result; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | |
@@ -466,11 +466,11 @@ discard block |
||
466 | 466 | */ |
467 | 467 | function mb_send_mail(string $to, string $subject, string $message, $additional_headers = null, string $additional_parameter = null): void |
468 | 468 | { |
469 | - error_clear_last(); |
|
470 | - $result = \mb_send_mail($to, $subject, $message, $additional_headers, $additional_parameter); |
|
471 | - if ($result === false) { |
|
472 | - throw MbstringException::createFromPhpError(); |
|
473 | - } |
|
469 | + error_clear_last(); |
|
470 | + $result = \mb_send_mail($to, $subject, $message, $additional_headers, $additional_parameter); |
|
471 | + if ($result === false) { |
|
472 | + throw MbstringException::createFromPhpError(); |
|
473 | + } |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | |
@@ -486,12 +486,12 @@ discard block |
||
486 | 486 | */ |
487 | 487 | function mb_split(string $pattern, string $string, int $limit = -1): array |
488 | 488 | { |
489 | - error_clear_last(); |
|
490 | - $result = \mb_split($pattern, $string, $limit); |
|
491 | - if ($result === false) { |
|
492 | - throw MbstringException::createFromPhpError(); |
|
493 | - } |
|
494 | - return $result; |
|
489 | + error_clear_last(); |
|
490 | + $result = \mb_split($pattern, $string, $limit); |
|
491 | + if ($result === false) { |
|
492 | + throw MbstringException::createFromPhpError(); |
|
493 | + } |
|
494 | + return $result; |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | |
@@ -513,14 +513,14 @@ discard block |
||
513 | 513 | */ |
514 | 514 | function mb_str_split(string $string, int $split_length = 1, string $encoding = null): array |
515 | 515 | { |
516 | - error_clear_last(); |
|
517 | - if ($encoding !== null) { |
|
518 | - $result = \mb_str_split($string, $split_length, $encoding); |
|
519 | - } else { |
|
520 | - $result = \mb_str_split($string, $split_length); |
|
521 | - } |
|
522 | - if ($result === false) { |
|
523 | - throw MbstringException::createFromPhpError(); |
|
524 | - } |
|
525 | - return $result; |
|
516 | + error_clear_last(); |
|
517 | + if ($encoding !== null) { |
|
518 | + $result = \mb_str_split($string, $split_length, $encoding); |
|
519 | + } else { |
|
520 | + $result = \mb_str_split($string, $split_length); |
|
521 | + } |
|
522 | + if ($result === false) { |
|
523 | + throw MbstringException::createFromPhpError(); |
|
524 | + } |
|
525 | + return $result; |
|
526 | 526 | } |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | */ |
22 | 22 | function mysqlnd_qc_clear_cache(): void |
23 | 23 | { |
24 | - error_clear_last(); |
|
25 | - $result = \mysqlnd_qc_clear_cache(); |
|
26 | - if ($result === false) { |
|
27 | - throw MysqlndQcException::createFromPhpError(); |
|
28 | - } |
|
24 | + error_clear_last(); |
|
25 | + $result = \mysqlnd_qc_clear_cache(); |
|
26 | + if ($result === false) { |
|
27 | + throw MysqlndQcException::createFromPhpError(); |
|
28 | + } |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | */ |
64 | 64 | function mysqlnd_qc_set_is_select(string $callback) |
65 | 65 | { |
66 | - error_clear_last(); |
|
67 | - $result = \mysqlnd_qc_set_is_select($callback); |
|
68 | - if ($result === false) { |
|
69 | - throw MysqlndQcException::createFromPhpError(); |
|
70 | - } |
|
71 | - return $result; |
|
66 | + error_clear_last(); |
|
67 | + $result = \mysqlnd_qc_set_is_select($callback); |
|
68 | + if ($result === false) { |
|
69 | + throw MysqlndQcException::createFromPhpError(); |
|
70 | + } |
|
71 | + return $result; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function mysqlnd_qc_set_storage_handler(string $handler): void |
97 | 97 | { |
98 | - error_clear_last(); |
|
99 | - $result = \mysqlnd_qc_set_storage_handler($handler); |
|
100 | - if ($result === false) { |
|
101 | - throw MysqlndQcException::createFromPhpError(); |
|
102 | - } |
|
98 | + error_clear_last(); |
|
99 | + $result = \mysqlnd_qc_set_storage_handler($handler); |
|
100 | + if ($result === false) { |
|
101 | + throw MysqlndQcException::createFromPhpError(); |
|
102 | + } |
|
103 | 103 | } |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function mysqlnd_ms_dump_servers($connection): array |
27 | 27 | { |
28 | - error_clear_last(); |
|
29 | - $result = \mysqlnd_ms_dump_servers($connection); |
|
30 | - if ($result === false) { |
|
31 | - throw MysqlndMsException::createFromPhpError(); |
|
32 | - } |
|
33 | - return $result; |
|
28 | + error_clear_last(); |
|
29 | + $result = \mysqlnd_ms_dump_servers($connection); |
|
30 | + if ($result === false) { |
|
31 | + throw MysqlndMsException::createFromPhpError(); |
|
32 | + } |
|
33 | + return $result; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | */ |
52 | 52 | function mysqlnd_ms_fabric_select_global($connection, $table_name): array |
53 | 53 | { |
54 | - error_clear_last(); |
|
55 | - $result = \mysqlnd_ms_fabric_select_global($connection, $table_name); |
|
56 | - if ($result === false) { |
|
57 | - throw MysqlndMsException::createFromPhpError(); |
|
58 | - } |
|
59 | - return $result; |
|
54 | + error_clear_last(); |
|
55 | + $result = \mysqlnd_ms_fabric_select_global($connection, $table_name); |
|
56 | + if ($result === false) { |
|
57 | + throw MysqlndMsException::createFromPhpError(); |
|
58 | + } |
|
59 | + return $result; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | */ |
79 | 79 | function mysqlnd_ms_fabric_select_shard($connection, $table_name, $shard_key): array |
80 | 80 | { |
81 | - error_clear_last(); |
|
82 | - $result = \mysqlnd_ms_fabric_select_shard($connection, $table_name, $shard_key); |
|
83 | - if ($result === false) { |
|
84 | - throw MysqlndMsException::createFromPhpError(); |
|
85 | - } |
|
86 | - return $result; |
|
81 | + error_clear_last(); |
|
82 | + $result = \mysqlnd_ms_fabric_select_shard($connection, $table_name, $shard_key); |
|
83 | + if ($result === false) { |
|
84 | + throw MysqlndMsException::createFromPhpError(); |
|
85 | + } |
|
86 | + return $result; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | */ |
111 | 111 | function mysqlnd_ms_get_last_used_connection($connection): array |
112 | 112 | { |
113 | - error_clear_last(); |
|
114 | - $result = \mysqlnd_ms_get_last_used_connection($connection); |
|
115 | - if ($result === false) { |
|
116 | - throw MysqlndMsException::createFromPhpError(); |
|
117 | - } |
|
118 | - return $result; |
|
113 | + error_clear_last(); |
|
114 | + $result = \mysqlnd_ms_get_last_used_connection($connection); |
|
115 | + if ($result === false) { |
|
116 | + throw MysqlndMsException::createFromPhpError(); |
|
117 | + } |
|
118 | + return $result; |
|
119 | 119 | } |