@@ -25,12 +25,12 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function iconv_get_encoding(string $type = "all") |
| 27 | 27 | { |
| 28 | - error_clear_last(); |
|
| 29 | - $result = \iconv_get_encoding($type); |
|
| 30 | - if ($result === false) { |
|
| 31 | - throw IconvException::createFromPhpError(); |
|
| 32 | - } |
|
| 33 | - return $result; |
|
| 28 | + error_clear_last(); |
|
| 29 | + $result = \iconv_get_encoding($type); |
|
| 30 | + if ($result === false) { |
|
| 31 | + throw IconvException::createFromPhpError(); |
|
| 32 | + } |
|
| 33 | + return $result; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | function iconv_set_encoding(string $type, string $charset): void |
| 52 | 52 | { |
| 53 | - error_clear_last(); |
|
| 54 | - $result = \iconv_set_encoding($type, $charset); |
|
| 55 | - if ($result === false) { |
|
| 56 | - throw IconvException::createFromPhpError(); |
|
| 57 | - } |
|
| 53 | + error_clear_last(); |
|
| 54 | + $result = \iconv_set_encoding($type, $charset); |
|
| 55 | + if ($result === false) { |
|
| 56 | + throw IconvException::createFromPhpError(); |
|
| 57 | + } |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | function iconv(string $in_charset, string $out_charset, string $str): string |
| 89 | 89 | { |
| 90 | - error_clear_last(); |
|
| 91 | - $result = \iconv($in_charset, $out_charset, $str); |
|
| 92 | - if ($result === false) { |
|
| 93 | - throw IconvException::createFromPhpError(); |
|
| 94 | - } |
|
| 95 | - return $result; |
|
| 90 | + error_clear_last(); |
|
| 91 | + $result = \iconv($in_charset, $out_charset, $str); |
|
| 92 | + if ($result === false) { |
|
| 93 | + throw IconvException::createFromPhpError(); |
|
| 94 | + } |
|
| 95 | + return $result; |
|
| 96 | 96 | } |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | function json_encode($value, int $options = 0, int $depth = 512): string |
| 46 | 46 | { |
| 47 | - error_clear_last(); |
|
| 48 | - $result = \json_encode($value, $options, $depth); |
|
| 49 | - if ($result === false) { |
|
| 50 | - throw JsonException::createFromPhpError(); |
|
| 51 | - } |
|
| 52 | - return $result; |
|
| 47 | + error_clear_last(); |
|
| 48 | + $result = \json_encode($value, $options, $depth); |
|
| 49 | + if ($result === false) { |
|
| 50 | + throw JsonException::createFromPhpError(); |
|
| 51 | + } |
|
| 52 | + return $result; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | function json_last_error_msg(): string |
| 66 | 66 | { |
| 67 | - error_clear_last(); |
|
| 68 | - $result = \json_last_error_msg(); |
|
| 69 | - if ($result === false) { |
|
| 70 | - throw JsonException::createFromPhpError(); |
|
| 71 | - } |
|
| 72 | - return $result; |
|
| 67 | + error_clear_last(); |
|
| 68 | + $result = \json_last_error_msg(); |
|
| 69 | + if ($result === false) { |
|
| 70 | + throw JsonException::createFromPhpError(); |
|
| 71 | + } |
|
| 72 | + return $result; |
|
| 73 | 73 | } |
@@ -13,11 +13,11 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | function readline_add_history(string $line): void |
| 15 | 15 | { |
| 16 | - error_clear_last(); |
|
| 17 | - $result = \readline_add_history($line); |
|
| 18 | - if ($result === false) { |
|
| 19 | - throw ReadlineException::createFromPhpError(); |
|
| 20 | - } |
|
| 16 | + error_clear_last(); |
|
| 17 | + $result = \readline_add_history($line); |
|
| 18 | + if ($result === false) { |
|
| 19 | + throw ReadlineException::createFromPhpError(); |
|
| 20 | + } |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | function readline_callback_handler_install(string $prompt, callable $callback): void |
| 74 | 74 | { |
| 75 | - error_clear_last(); |
|
| 76 | - $result = \readline_callback_handler_install($prompt, $callback); |
|
| 77 | - if ($result === false) { |
|
| 78 | - throw ReadlineException::createFromPhpError(); |
|
| 79 | - } |
|
| 75 | + error_clear_last(); |
|
| 76 | + $result = \readline_callback_handler_install($prompt, $callback); |
|
| 77 | + if ($result === false) { |
|
| 78 | + throw ReadlineException::createFromPhpError(); |
|
| 79 | + } |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | function readline_clear_history(): void |
| 90 | 90 | { |
| 91 | - error_clear_last(); |
|
| 92 | - $result = \readline_clear_history(); |
|
| 93 | - if ($result === false) { |
|
| 94 | - throw ReadlineException::createFromPhpError(); |
|
| 95 | - } |
|
| 91 | + error_clear_last(); |
|
| 92 | + $result = \readline_clear_history(); |
|
| 93 | + if ($result === false) { |
|
| 94 | + throw ReadlineException::createFromPhpError(); |
|
| 95 | + } |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | function readline_completion_function(callable $function): void |
| 109 | 109 | { |
| 110 | - error_clear_last(); |
|
| 111 | - $result = \readline_completion_function($function); |
|
| 112 | - if ($result === false) { |
|
| 113 | - throw ReadlineException::createFromPhpError(); |
|
| 114 | - } |
|
| 110 | + error_clear_last(); |
|
| 111 | + $result = \readline_completion_function($function); |
|
| 112 | + if ($result === false) { |
|
| 113 | + throw ReadlineException::createFromPhpError(); |
|
| 114 | + } |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
@@ -124,15 +124,15 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | function readline_read_history(string $filename = null): void |
| 126 | 126 | { |
| 127 | - error_clear_last(); |
|
| 128 | - if ($filename !== null) { |
|
| 129 | - $result = \readline_read_history($filename); |
|
| 130 | - } else { |
|
| 131 | - $result = \readline_read_history(); |
|
| 132 | - } |
|
| 133 | - if ($result === false) { |
|
| 134 | - throw ReadlineException::createFromPhpError(); |
|
| 135 | - } |
|
| 127 | + error_clear_last(); |
|
| 128 | + if ($filename !== null) { |
|
| 129 | + $result = \readline_read_history($filename); |
|
| 130 | + } else { |
|
| 131 | + $result = \readline_read_history(); |
|
| 132 | + } |
|
| 133 | + if ($result === false) { |
|
| 134 | + throw ReadlineException::createFromPhpError(); |
|
| 135 | + } |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | function readline_write_history(string $filename = null): void |
| 147 | 147 | { |
| 148 | - error_clear_last(); |
|
| 149 | - if ($filename !== null) { |
|
| 150 | - $result = \readline_write_history($filename); |
|
| 151 | - } else { |
|
| 152 | - $result = \readline_write_history(); |
|
| 153 | - } |
|
| 154 | - if ($result === false) { |
|
| 155 | - throw ReadlineException::createFromPhpError(); |
|
| 156 | - } |
|
| 148 | + error_clear_last(); |
|
| 149 | + if ($filename !== null) { |
|
| 150 | + $result = \readline_write_history($filename); |
|
| 151 | + } else { |
|
| 152 | + $result = \readline_write_history(); |
|
| 153 | + } |
|
| 154 | + if ($result === false) { |
|
| 155 | + throw ReadlineException::createFromPhpError(); |
|
| 156 | + } |
|
| 157 | 157 | } |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function cubrid_free_result($req_identifier): void |
| 18 | 18 | { |
| 19 | - error_clear_last(); |
|
| 20 | - $result = \cubrid_free_result($req_identifier); |
|
| 21 | - if ($result === false) { |
|
| 22 | - throw CubridException::createFromPhpError(); |
|
| 23 | - } |
|
| 19 | + error_clear_last(); |
|
| 20 | + $result = \cubrid_free_result($req_identifier); |
|
| 21 | + if ($result === false) { |
|
| 22 | + throw CubridException::createFromPhpError(); |
|
| 23 | + } |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | function cubrid_get_charset($conn_identifier): string |
| 40 | 40 | { |
| 41 | - error_clear_last(); |
|
| 42 | - $result = \cubrid_get_charset($conn_identifier); |
|
| 43 | - if ($result === false) { |
|
| 44 | - throw CubridException::createFromPhpError(); |
|
| 45 | - } |
|
| 46 | - return $result; |
|
| 41 | + error_clear_last(); |
|
| 42 | + $result = \cubrid_get_charset($conn_identifier); |
|
| 43 | + if ($result === false) { |
|
| 44 | + throw CubridException::createFromPhpError(); |
|
| 45 | + } |
|
| 46 | + return $result; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | function cubrid_get_client_info(): string |
| 60 | 60 | { |
| 61 | - error_clear_last(); |
|
| 62 | - $result = \cubrid_get_client_info(); |
|
| 63 | - if ($result === false) { |
|
| 64 | - throw CubridException::createFromPhpError(); |
|
| 65 | - } |
|
| 66 | - return $result; |
|
| 61 | + error_clear_last(); |
|
| 62 | + $result = \cubrid_get_client_info(); |
|
| 63 | + if ($result === false) { |
|
| 64 | + throw CubridException::createFromPhpError(); |
|
| 65 | + } |
|
| 66 | + return $result; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
@@ -185,12 +185,12 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | function cubrid_get_db_parameter($conn_identifier): array |
| 187 | 187 | { |
| 188 | - error_clear_last(); |
|
| 189 | - $result = \cubrid_get_db_parameter($conn_identifier); |
|
| 190 | - if ($result === false) { |
|
| 191 | - throw CubridException::createFromPhpError(); |
|
| 192 | - } |
|
| 193 | - return $result; |
|
| 188 | + error_clear_last(); |
|
| 189 | + $result = \cubrid_get_db_parameter($conn_identifier); |
|
| 190 | + if ($result === false) { |
|
| 191 | + throw CubridException::createFromPhpError(); |
|
| 192 | + } |
|
| 193 | + return $result; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
@@ -206,12 +206,12 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | function cubrid_get_server_info($conn_identifier): string |
| 208 | 208 | { |
| 209 | - error_clear_last(); |
|
| 210 | - $result = \cubrid_get_server_info($conn_identifier); |
|
| 211 | - if ($result === false) { |
|
| 212 | - throw CubridException::createFromPhpError(); |
|
| 213 | - } |
|
| 214 | - return $result; |
|
| 209 | + error_clear_last(); |
|
| 210 | + $result = \cubrid_get_server_info($conn_identifier); |
|
| 211 | + if ($result === false) { |
|
| 212 | + throw CubridException::createFromPhpError(); |
|
| 213 | + } |
|
| 214 | + return $result; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
@@ -234,16 +234,16 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | function cubrid_insert_id($conn_identifier = null): string |
| 236 | 236 | { |
| 237 | - error_clear_last(); |
|
| 238 | - if ($conn_identifier !== null) { |
|
| 239 | - $result = \cubrid_insert_id($conn_identifier); |
|
| 240 | - } else { |
|
| 241 | - $result = \cubrid_insert_id(); |
|
| 242 | - } |
|
| 243 | - if ($result === false) { |
|
| 244 | - throw CubridException::createFromPhpError(); |
|
| 245 | - } |
|
| 246 | - return $result; |
|
| 237 | + error_clear_last(); |
|
| 238 | + if ($conn_identifier !== null) { |
|
| 239 | + $result = \cubrid_insert_id($conn_identifier); |
|
| 240 | + } else { |
|
| 241 | + $result = \cubrid_insert_id(); |
|
| 242 | + } |
|
| 243 | + if ($result === false) { |
|
| 244 | + throw CubridException::createFromPhpError(); |
|
| 245 | + } |
|
| 246 | + return $result; |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | |
@@ -263,18 +263,18 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | function cubrid_lob2_new($conn_identifier = null, string $type = "BLOB") |
| 265 | 265 | { |
| 266 | - error_clear_last(); |
|
| 267 | - if ($type !== "BLOB") { |
|
| 268 | - $result = \cubrid_lob2_new($conn_identifier, $type); |
|
| 269 | - } elseif ($conn_identifier !== null) { |
|
| 270 | - $result = \cubrid_lob2_new($conn_identifier); |
|
| 271 | - } else { |
|
| 272 | - $result = \cubrid_lob2_new(); |
|
| 273 | - } |
|
| 274 | - if ($result === false) { |
|
| 275 | - throw CubridException::createFromPhpError(); |
|
| 276 | - } |
|
| 277 | - return $result; |
|
| 266 | + error_clear_last(); |
|
| 267 | + if ($type !== "BLOB") { |
|
| 268 | + $result = \cubrid_lob2_new($conn_identifier, $type); |
|
| 269 | + } elseif ($conn_identifier !== null) { |
|
| 270 | + $result = \cubrid_lob2_new($conn_identifier); |
|
| 271 | + } else { |
|
| 272 | + $result = \cubrid_lob2_new(); |
|
| 273 | + } |
|
| 274 | + if ($result === false) { |
|
| 275 | + throw CubridException::createFromPhpError(); |
|
| 276 | + } |
|
| 277 | + return $result; |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | |
@@ -290,12 +290,12 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | function cubrid_lob2_size($lob_identifier): int |
| 292 | 292 | { |
| 293 | - error_clear_last(); |
|
| 294 | - $result = \cubrid_lob2_size($lob_identifier); |
|
| 295 | - if ($result === false) { |
|
| 296 | - throw CubridException::createFromPhpError(); |
|
| 297 | - } |
|
| 298 | - return $result; |
|
| 293 | + error_clear_last(); |
|
| 294 | + $result = \cubrid_lob2_size($lob_identifier); |
|
| 295 | + if ($result === false) { |
|
| 296 | + throw CubridException::createFromPhpError(); |
|
| 297 | + } |
|
| 298 | + return $result; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | |
@@ -314,12 +314,12 @@ discard block |
||
| 314 | 314 | */ |
| 315 | 315 | function cubrid_lob2_size64($lob_identifier): string |
| 316 | 316 | { |
| 317 | - error_clear_last(); |
|
| 318 | - $result = \cubrid_lob2_size64($lob_identifier); |
|
| 319 | - if ($result === false) { |
|
| 320 | - throw CubridException::createFromPhpError(); |
|
| 321 | - } |
|
| 322 | - return $result; |
|
| 317 | + error_clear_last(); |
|
| 318 | + $result = \cubrid_lob2_size64($lob_identifier); |
|
| 319 | + if ($result === false) { |
|
| 320 | + throw CubridException::createFromPhpError(); |
|
| 321 | + } |
|
| 322 | + return $result; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
@@ -335,12 +335,12 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | function cubrid_lob2_tell($lob_identifier): int |
| 337 | 337 | { |
| 338 | - error_clear_last(); |
|
| 339 | - $result = \cubrid_lob2_tell($lob_identifier); |
|
| 340 | - if ($result === false) { |
|
| 341 | - throw CubridException::createFromPhpError(); |
|
| 342 | - } |
|
| 343 | - return $result; |
|
| 338 | + error_clear_last(); |
|
| 339 | + $result = \cubrid_lob2_tell($lob_identifier); |
|
| 340 | + if ($result === false) { |
|
| 341 | + throw CubridException::createFromPhpError(); |
|
| 342 | + } |
|
| 343 | + return $result; |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | |
@@ -359,12 +359,12 @@ discard block |
||
| 359 | 359 | */ |
| 360 | 360 | function cubrid_lob2_tell64($lob_identifier): string |
| 361 | 361 | { |
| 362 | - error_clear_last(); |
|
| 363 | - $result = \cubrid_lob2_tell64($lob_identifier); |
|
| 364 | - if ($result === false) { |
|
| 365 | - throw CubridException::createFromPhpError(); |
|
| 366 | - } |
|
| 367 | - return $result; |
|
| 362 | + error_clear_last(); |
|
| 363 | + $result = \cubrid_lob2_tell64($lob_identifier); |
|
| 364 | + if ($result === false) { |
|
| 365 | + throw CubridException::createFromPhpError(); |
|
| 366 | + } |
|
| 367 | + return $result; |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | |
@@ -387,9 +387,9 @@ discard block |
||
| 387 | 387 | */ |
| 388 | 388 | function cubrid_set_db_parameter($conn_identifier, int $param_type, int $param_value): void |
| 389 | 389 | { |
| 390 | - error_clear_last(); |
|
| 391 | - $result = \cubrid_set_db_parameter($conn_identifier, $param_type, $param_value); |
|
| 392 | - if ($result === false) { |
|
| 393 | - throw CubridException::createFromPhpError(); |
|
| 394 | - } |
|
| 390 | + error_clear_last(); |
|
| 391 | + $result = \cubrid_set_db_parameter($conn_identifier, $param_type, $param_value); |
|
| 392 | + if ($result === false) { |
|
| 393 | + throw CubridException::createFromPhpError(); |
|
| 394 | + } |
|
| 395 | 395 | } |
@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | function simplexml_import_dom(\DOMNode $node, string $class_name = "SimpleXMLElement"): \SimpleXMLElement |
| 22 | 22 | { |
| 23 | - error_clear_last(); |
|
| 24 | - $result = \simplexml_import_dom($node, $class_name); |
|
| 25 | - if ($result === false) { |
|
| 26 | - throw SimplexmlException::createFromPhpError(); |
|
| 27 | - } |
|
| 28 | - return $result; |
|
| 23 | + error_clear_last(); |
|
| 24 | + $result = \simplexml_import_dom($node, $class_name); |
|
| 25 | + if ($result === false) { |
|
| 26 | + throw SimplexmlException::createFromPhpError(); |
|
| 27 | + } |
|
| 28 | + return $result; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | function simplexml_load_file(string $filename, string $class_name = "SimpleXMLElement", int $options = 0, string $ns = "", bool $is_prefix = false): \SimpleXMLElement |
| 58 | 58 | { |
| 59 | - error_clear_last(); |
|
| 60 | - $result = \simplexml_load_file($filename, $class_name, $options, $ns, $is_prefix); |
|
| 61 | - if ($result === false) { |
|
| 62 | - throw SimplexmlException::createFromPhpError(); |
|
| 63 | - } |
|
| 64 | - return $result; |
|
| 59 | + error_clear_last(); |
|
| 60 | + $result = \simplexml_load_file($filename, $class_name, $options, $ns, $is_prefix); |
|
| 61 | + if ($result === false) { |
|
| 62 | + throw SimplexmlException::createFromPhpError(); |
|
| 63 | + } |
|
| 64 | + return $result; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | function simplexml_load_string(string $data, string $class_name = "SimpleXMLElement", int $options = 0, string $ns = "", bool $is_prefix = false): \SimpleXMLElement |
| 87 | 87 | { |
| 88 | - error_clear_last(); |
|
| 89 | - $result = \simplexml_load_string($data, $class_name, $options, $ns, $is_prefix); |
|
| 90 | - if ($result === false) { |
|
| 91 | - throw SimplexmlException::createFromPhpError(); |
|
| 92 | - } |
|
| 93 | - return $result; |
|
| 88 | + error_clear_last(); |
|
| 89 | + $result = \simplexml_load_string($data, $class_name, $options, $ns, $is_prefix); |
|
| 90 | + if ($result === false) { |
|
| 91 | + throw SimplexmlException::createFromPhpError(); |
|
| 92 | + } |
|
| 93 | + return $result; |
|
| 94 | 94 | } |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | function xmlrpc_set_type(&$value, string $type): void |
| 16 | 16 | { |
| 17 | - error_clear_last(); |
|
| 18 | - $result = \xmlrpc_set_type($value, $type); |
|
| 19 | - if ($result === false) { |
|
| 20 | - throw XmlrpcException::createFromPhpError(); |
|
| 21 | - } |
|
| 17 | + error_clear_last(); |
|
| 18 | + $result = \xmlrpc_set_type($value, $type); |
|
| 19 | + if ($result === false) { |
|
| 20 | + throw XmlrpcException::createFromPhpError(); |
|
| 21 | + } |
|
| 22 | 22 | } |
@@ -48,16 +48,16 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | function db2_autocommit($connection, int $value = null) |
| 50 | 50 | { |
| 51 | - error_clear_last(); |
|
| 52 | - if ($value !== null) { |
|
| 53 | - $result = \db2_autocommit($connection, $value); |
|
| 54 | - } else { |
|
| 55 | - $result = \db2_autocommit($connection); |
|
| 56 | - } |
|
| 57 | - if ($result === false) { |
|
| 58 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 59 | - } |
|
| 60 | - return $result; |
|
| 51 | + error_clear_last(); |
|
| 52 | + if ($value !== null) { |
|
| 53 | + $result = \db2_autocommit($connection, $value); |
|
| 54 | + } else { |
|
| 55 | + $result = \db2_autocommit($connection); |
|
| 56 | + } |
|
| 57 | + if ($result === false) { |
|
| 58 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 59 | + } |
|
| 60 | + return $result; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -98,21 +98,21 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | function db2_bind_param($stmt, int $parameter_number, string $variable_name, int $parameter_type = null, int $data_type = 0, int $precision = -1, int $scale = 0): void |
| 100 | 100 | { |
| 101 | - error_clear_last(); |
|
| 102 | - if ($scale !== 0) { |
|
| 103 | - $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision, $scale); |
|
| 104 | - } elseif ($precision !== -1) { |
|
| 105 | - $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision); |
|
| 106 | - } elseif ($data_type !== 0) { |
|
| 107 | - $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type); |
|
| 108 | - } elseif ($parameter_type !== null) { |
|
| 109 | - $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type); |
|
| 110 | - } else { |
|
| 111 | - $result = \db2_bind_param($stmt, $parameter_number, $variable_name); |
|
| 112 | - } |
|
| 113 | - if ($result === false) { |
|
| 114 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 115 | - } |
|
| 101 | + error_clear_last(); |
|
| 102 | + if ($scale !== 0) { |
|
| 103 | + $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision, $scale); |
|
| 104 | + } elseif ($precision !== -1) { |
|
| 105 | + $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision); |
|
| 106 | + } elseif ($data_type !== 0) { |
|
| 107 | + $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type); |
|
| 108 | + } elseif ($parameter_type !== null) { |
|
| 109 | + $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type); |
|
| 110 | + } else { |
|
| 111 | + $result = \db2_bind_param($stmt, $parameter_number, $variable_name); |
|
| 112 | + } |
|
| 113 | + if ($result === false) { |
|
| 114 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 115 | + } |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
@@ -227,12 +227,12 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | function db2_client_info($connection): object |
| 229 | 229 | { |
| 230 | - error_clear_last(); |
|
| 231 | - $result = \db2_client_info($connection); |
|
| 232 | - if ($result === false) { |
|
| 233 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 234 | - } |
|
| 235 | - return $result; |
|
| 230 | + error_clear_last(); |
|
| 231 | + $result = \db2_client_info($connection); |
|
| 232 | + if ($result === false) { |
|
| 233 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 234 | + } |
|
| 235 | + return $result; |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | |
@@ -251,11 +251,11 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | function db2_close($connection): void |
| 253 | 253 | { |
| 254 | - error_clear_last(); |
|
| 255 | - $result = \db2_close($connection); |
|
| 256 | - if ($result === false) { |
|
| 257 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 258 | - } |
|
| 254 | + error_clear_last(); |
|
| 255 | + $result = \db2_close($connection); |
|
| 256 | + if ($result === false) { |
|
| 257 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 258 | + } |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | |
@@ -272,11 +272,11 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | function db2_commit($connection): void |
| 274 | 274 | { |
| 275 | - error_clear_last(); |
|
| 276 | - $result = \db2_commit($connection); |
|
| 277 | - if ($result === false) { |
|
| 278 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 279 | - } |
|
| 275 | + error_clear_last(); |
|
| 276 | + $result = \db2_commit($connection); |
|
| 277 | + if ($result === false) { |
|
| 278 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 279 | + } |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
@@ -306,15 +306,15 @@ discard block |
||
| 306 | 306 | */ |
| 307 | 307 | function db2_execute($stmt, array $parameters = null): void |
| 308 | 308 | { |
| 309 | - error_clear_last(); |
|
| 310 | - if ($parameters !== null) { |
|
| 311 | - $result = \db2_execute($stmt, $parameters); |
|
| 312 | - } else { |
|
| 313 | - $result = \db2_execute($stmt); |
|
| 314 | - } |
|
| 315 | - if ($result === false) { |
|
| 316 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 317 | - } |
|
| 309 | + error_clear_last(); |
|
| 310 | + if ($parameters !== null) { |
|
| 311 | + $result = \db2_execute($stmt, $parameters); |
|
| 312 | + } else { |
|
| 313 | + $result = \db2_execute($stmt); |
|
| 314 | + } |
|
| 315 | + if ($result === false) { |
|
| 316 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 317 | + } |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | |
@@ -330,11 +330,11 @@ discard block |
||
| 330 | 330 | */ |
| 331 | 331 | function db2_free_result($stmt): void |
| 332 | 332 | { |
| 333 | - error_clear_last(); |
|
| 334 | - $result = \db2_free_result($stmt); |
|
| 335 | - if ($result === false) { |
|
| 336 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 337 | - } |
|
| 333 | + error_clear_last(); |
|
| 334 | + $result = \db2_free_result($stmt); |
|
| 335 | + if ($result === false) { |
|
| 336 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 337 | + } |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | |
@@ -350,11 +350,11 @@ discard block |
||
| 350 | 350 | */ |
| 351 | 351 | function db2_free_stmt($stmt): void |
| 352 | 352 | { |
| 353 | - error_clear_last(); |
|
| 354 | - $result = \db2_free_stmt($stmt); |
|
| 355 | - if ($result === false) { |
|
| 356 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 357 | - } |
|
| 353 | + error_clear_last(); |
|
| 354 | + $result = \db2_free_stmt($stmt); |
|
| 355 | + if ($result === false) { |
|
| 356 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 357 | + } |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | |
@@ -510,12 +510,12 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | function db2_get_option($resource, string $option): string |
| 512 | 512 | { |
| 513 | - error_clear_last(); |
|
| 514 | - $result = \db2_get_option($resource, $option); |
|
| 515 | - if ($result === false) { |
|
| 516 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 517 | - } |
|
| 518 | - return $result; |
|
| 513 | + error_clear_last(); |
|
| 514 | + $result = \db2_get_option($resource, $option); |
|
| 515 | + if ($result === false) { |
|
| 516 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 517 | + } |
|
| 518 | + return $result; |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | |
@@ -543,11 +543,11 @@ discard block |
||
| 543 | 543 | */ |
| 544 | 544 | function db2_pclose($resource): void |
| 545 | 545 | { |
| 546 | - error_clear_last(); |
|
| 547 | - $result = \db2_pclose($resource); |
|
| 548 | - if ($result === false) { |
|
| 549 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 550 | - } |
|
| 546 | + error_clear_last(); |
|
| 547 | + $result = \db2_pclose($resource); |
|
| 548 | + if ($result === false) { |
|
| 549 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 550 | + } |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | |
@@ -564,11 +564,11 @@ discard block |
||
| 564 | 564 | */ |
| 565 | 565 | function db2_rollback($connection): void |
| 566 | 566 | { |
| 567 | - error_clear_last(); |
|
| 568 | - $result = \db2_rollback($connection); |
|
| 569 | - if ($result === false) { |
|
| 570 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 571 | - } |
|
| 567 | + error_clear_last(); |
|
| 568 | + $result = \db2_rollback($connection); |
|
| 569 | + if ($result === false) { |
|
| 570 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 571 | + } |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | |
@@ -825,12 +825,12 @@ discard block |
||
| 825 | 825 | */ |
| 826 | 826 | function db2_server_info($connection): object |
| 827 | 827 | { |
| 828 | - error_clear_last(); |
|
| 829 | - $result = \db2_server_info($connection); |
|
| 830 | - if ($result === false) { |
|
| 831 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 832 | - } |
|
| 833 | - return $result; |
|
| 828 | + error_clear_last(); |
|
| 829 | + $result = \db2_server_info($connection); |
|
| 830 | + if ($result === false) { |
|
| 831 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 832 | + } |
|
| 833 | + return $result; |
|
| 834 | 834 | } |
| 835 | 835 | |
| 836 | 836 | |
@@ -1213,9 +1213,9 @@ discard block |
||
| 1213 | 1213 | */ |
| 1214 | 1214 | function db2_set_option($resource, array $options, int $type): void |
| 1215 | 1215 | { |
| 1216 | - error_clear_last(); |
|
| 1217 | - $result = \db2_set_option($resource, $options, $type); |
|
| 1218 | - if ($result === false) { |
|
| 1219 | - throw IbmDb2Exception::createFromPhpError(); |
|
| 1220 | - } |
|
| 1216 | + error_clear_last(); |
|
| 1217 | + $result = \db2_set_option($resource, $options, $type); |
|
| 1218 | + if ($result === false) { |
|
| 1219 | + throw IbmDb2Exception::createFromPhpError(); |
|
| 1220 | + } |
|
| 1221 | 1221 | } |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | function sodium_crypto_pwhash_str(string $password, int $opslimit, int $memlimit): string |
| 23 | 23 | { |
| 24 | - error_clear_last(); |
|
| 25 | - $result = \sodium_crypto_pwhash_str($password, $opslimit, $memlimit); |
|
| 26 | - if ($result === false) { |
|
| 27 | - throw SodiumException::createFromPhpError(); |
|
| 28 | - } |
|
| 29 | - return $result; |
|
| 24 | + error_clear_last(); |
|
| 25 | + $result = \sodium_crypto_pwhash_str($password, $opslimit, $memlimit); |
|
| 26 | + if ($result === false) { |
|
| 27 | + throw SodiumException::createFromPhpError(); |
|
| 28 | + } |
|
| 29 | + return $result; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | function sodium_crypto_pwhash(int $length, string $password, string $salt, int $opslimit, int $memlimit, int $alg = null): string |
| 47 | 47 | { |
| 48 | - error_clear_last(); |
|
| 49 | - if ($alg !== null) { |
|
| 50 | - $result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit, $alg); |
|
| 51 | - } else { |
|
| 52 | - $result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit); |
|
| 53 | - } |
|
| 54 | - if ($result === false) { |
|
| 55 | - throw SodiumException::createFromPhpError(); |
|
| 56 | - } |
|
| 57 | - return $result; |
|
| 48 | + error_clear_last(); |
|
| 49 | + if ($alg !== null) { |
|
| 50 | + $result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit, $alg); |
|
| 51 | + } else { |
|
| 52 | + $result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit); |
|
| 53 | + } |
|
| 54 | + if ($result === false) { |
|
| 55 | + throw SodiumException::createFromPhpError(); |
|
| 56 | + } |
|
| 57 | + return $result; |
|
| 58 | 58 | } |
@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | function uopz_extend(string $class, string $parent): void |
| 16 | 16 | { |
| 17 | - error_clear_last(); |
|
| 18 | - $result = \uopz_extend($class, $parent); |
|
| 19 | - if ($result === false) { |
|
| 20 | - throw UopzException::createFromPhpError(); |
|
| 21 | - } |
|
| 17 | + error_clear_last(); |
|
| 18 | + $result = \uopz_extend($class, $parent); |
|
| 19 | + if ($result === false) { |
|
| 20 | + throw UopzException::createFromPhpError(); |
|
| 21 | + } |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | function uopz_implement(string $class, string $interface): void |
| 34 | 34 | { |
| 35 | - error_clear_last(); |
|
| 36 | - $result = \uopz_implement($class, $interface); |
|
| 37 | - if ($result === false) { |
|
| 38 | - throw UopzException::createFromPhpError(); |
|
| 39 | - } |
|
| 35 | + error_clear_last(); |
|
| 36 | + $result = \uopz_implement($class, $interface); |
|
| 37 | + if ($result === false) { |
|
| 38 | + throw UopzException::createFromPhpError(); |
|
| 39 | + } |
|
| 40 | 40 | } |