@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function mailparse_msg_extract_part_file($mimemail, $filename, callable $callbackfunc = null): string |
30 | 30 | { |
31 | - error_clear_last(); |
|
32 | - if ($callbackfunc !== null) { |
|
33 | - $result = \mailparse_msg_extract_part_file($mimemail, $filename, $callbackfunc); |
|
34 | - } else { |
|
35 | - $result = \mailparse_msg_extract_part_file($mimemail, $filename); |
|
36 | - } |
|
37 | - if ($result === false) { |
|
38 | - throw MailparseException::createFromPhpError(); |
|
39 | - } |
|
40 | - return $result; |
|
31 | + error_clear_last(); |
|
32 | + if ($callbackfunc !== null) { |
|
33 | + $result = \mailparse_msg_extract_part_file($mimemail, $filename, $callbackfunc); |
|
34 | + } else { |
|
35 | + $result = \mailparse_msg_extract_part_file($mimemail, $filename); |
|
36 | + } |
|
37 | + if ($result === false) { |
|
38 | + throw MailparseException::createFromPhpError(); |
|
39 | + } |
|
40 | + return $result; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | */ |
53 | 53 | function mailparse_msg_free($mimemail): void |
54 | 54 | { |
55 | - error_clear_last(); |
|
56 | - $result = \mailparse_msg_free($mimemail); |
|
57 | - if ($result === false) { |
|
58 | - throw MailparseException::createFromPhpError(); |
|
59 | - } |
|
55 | + error_clear_last(); |
|
56 | + $result = \mailparse_msg_free($mimemail); |
|
57 | + if ($result === false) { |
|
58 | + throw MailparseException::createFromPhpError(); |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -75,12 +75,12 @@ discard block |
||
75 | 75 | */ |
76 | 76 | function mailparse_msg_parse_file(string $filename) |
77 | 77 | { |
78 | - error_clear_last(); |
|
79 | - $result = \mailparse_msg_parse_file($filename); |
|
80 | - if ($result === false) { |
|
81 | - throw MailparseException::createFromPhpError(); |
|
82 | - } |
|
83 | - return $result; |
|
78 | + error_clear_last(); |
|
79 | + $result = \mailparse_msg_parse_file($filename); |
|
80 | + if ($result === false) { |
|
81 | + throw MailparseException::createFromPhpError(); |
|
82 | + } |
|
83 | + return $result; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | */ |
99 | 99 | function mailparse_msg_parse($mimemail, string $data): void |
100 | 100 | { |
101 | - error_clear_last(); |
|
102 | - $result = \mailparse_msg_parse($mimemail, $data); |
|
103 | - if ($result === false) { |
|
104 | - throw MailparseException::createFromPhpError(); |
|
105 | - } |
|
101 | + error_clear_last(); |
|
102 | + $result = \mailparse_msg_parse($mimemail, $data); |
|
103 | + if ($result === false) { |
|
104 | + throw MailparseException::createFromPhpError(); |
|
105 | + } |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function mailparse_stream_encode($sourcefp, $destfp, string $encoding): void |
121 | 121 | { |
122 | - error_clear_last(); |
|
123 | - $result = \mailparse_stream_encode($sourcefp, $destfp, $encoding); |
|
124 | - if ($result === false) { |
|
125 | - throw MailparseException::createFromPhpError(); |
|
126 | - } |
|
122 | + error_clear_last(); |
|
123 | + $result = \mailparse_stream_encode($sourcefp, $destfp, $encoding); |
|
124 | + if ($result === false) { |
|
125 | + throw MailparseException::createFromPhpError(); |
|
126 | + } |
|
127 | 127 | } |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) |
27 | 27 | { |
28 | - error_clear_last(); |
|
29 | - $result = \yaml_parse_file($filename, $pos, $ndocs, $callbacks); |
|
30 | - if ($result === false) { |
|
31 | - throw YamlException::createFromPhpError(); |
|
32 | - } |
|
33 | - return $result; |
|
28 | + error_clear_last(); |
|
29 | + $result = \yaml_parse_file($filename, $pos, $ndocs, $callbacks); |
|
30 | + if ($result === false) { |
|
31 | + throw YamlException::createFromPhpError(); |
|
32 | + } |
|
33 | + return $result; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | */ |
59 | 59 | function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) |
60 | 60 | { |
61 | - error_clear_last(); |
|
62 | - $result = \yaml_parse_url($url, $pos, $ndocs, $callbacks); |
|
63 | - if ($result === false) { |
|
64 | - throw YamlException::createFromPhpError(); |
|
65 | - } |
|
66 | - return $result; |
|
61 | + error_clear_last(); |
|
62 | + $result = \yaml_parse_url($url, $pos, $ndocs, $callbacks); |
|
63 | + if ($result === false) { |
|
64 | + throw YamlException::createFromPhpError(); |
|
65 | + } |
|
66 | + return $result; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | */ |
89 | 89 | function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) |
90 | 90 | { |
91 | - error_clear_last(); |
|
92 | - $result = \yaml_parse($input, $pos, $ndocs, $callbacks); |
|
93 | - if ($result === false) { |
|
94 | - throw YamlException::createFromPhpError(); |
|
95 | - } |
|
96 | - return $result; |
|
91 | + error_clear_last(); |
|
92 | + $result = \yaml_parse($input, $pos, $ndocs, $callbacks); |
|
93 | + if ($result === false) { |
|
94 | + throw YamlException::createFromPhpError(); |
|
95 | + } |
|
96 | + return $result; |
|
97 | 97 | } |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function inotify_init() |
16 | 16 | { |
17 | - error_clear_last(); |
|
18 | - $result = \inotify_init(); |
|
19 | - if ($result === false) { |
|
20 | - throw InotifyException::createFromPhpError(); |
|
21 | - } |
|
22 | - return $result; |
|
17 | + error_clear_last(); |
|
18 | + $result = \inotify_init(); |
|
19 | + if ($result === false) { |
|
20 | + throw InotifyException::createFromPhpError(); |
|
21 | + } |
|
22 | + return $result; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | */ |
37 | 37 | function inotify_rm_watch($inotify_instance, int $watch_descriptor): void |
38 | 38 | { |
39 | - error_clear_last(); |
|
40 | - $result = \inotify_rm_watch($inotify_instance, $watch_descriptor); |
|
41 | - if ($result === false) { |
|
42 | - throw InotifyException::createFromPhpError(); |
|
43 | - } |
|
39 | + error_clear_last(); |
|
40 | + $result = \inotify_rm_watch($inotify_instance, $watch_descriptor); |
|
41 | + if ($result === false) { |
|
42 | + throw InotifyException::createFromPhpError(); |
|
43 | + } |
|
44 | 44 | } |
@@ -16,17 +16,17 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function swoole_async_write(string $filename, string $content, int $offset = null, callable $callback = null): void |
18 | 18 | { |
19 | - error_clear_last(); |
|
20 | - if ($callback !== null) { |
|
21 | - $result = \swoole_async_write($filename, $content, $offset, $callback); |
|
22 | - } elseif ($offset !== null) { |
|
23 | - $result = \swoole_async_write($filename, $content, $offset); |
|
24 | - } else { |
|
25 | - $result = \swoole_async_write($filename, $content); |
|
26 | - } |
|
27 | - if ($result === false) { |
|
28 | - throw SwooleException::createFromPhpError(); |
|
29 | - } |
|
19 | + error_clear_last(); |
|
20 | + if ($callback !== null) { |
|
21 | + $result = \swoole_async_write($filename, $content, $offset, $callback); |
|
22 | + } elseif ($offset !== null) { |
|
23 | + $result = \swoole_async_write($filename, $content, $offset); |
|
24 | + } else { |
|
25 | + $result = \swoole_async_write($filename, $content); |
|
26 | + } |
|
27 | + if ($result === false) { |
|
28 | + throw SwooleException::createFromPhpError(); |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | */ |
43 | 43 | function swoole_async_writefile(string $filename, string $content, callable $callback = null, int $flags = 0): void |
44 | 44 | { |
45 | - error_clear_last(); |
|
46 | - if ($flags !== 0) { |
|
47 | - $result = \swoole_async_writefile($filename, $content, $callback, $flags); |
|
48 | - } elseif ($callback !== null) { |
|
49 | - $result = \swoole_async_writefile($filename, $content, $callback); |
|
50 | - } else { |
|
51 | - $result = \swoole_async_writefile($filename, $content); |
|
52 | - } |
|
53 | - if ($result === false) { |
|
54 | - throw SwooleException::createFromPhpError(); |
|
55 | - } |
|
45 | + error_clear_last(); |
|
46 | + if ($flags !== 0) { |
|
47 | + $result = \swoole_async_writefile($filename, $content, $callback, $flags); |
|
48 | + } elseif ($callback !== null) { |
|
49 | + $result = \swoole_async_writefile($filename, $content, $callback); |
|
50 | + } else { |
|
51 | + $result = \swoole_async_writefile($filename, $content); |
|
52 | + } |
|
53 | + if ($result === false) { |
|
54 | + throw SwooleException::createFromPhpError(); |
|
55 | + } |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | */ |
66 | 66 | function swoole_event_defer(callable $callback): void |
67 | 67 | { |
68 | - error_clear_last(); |
|
69 | - $result = \swoole_event_defer($callback); |
|
70 | - if ($result === false) { |
|
71 | - throw SwooleException::createFromPhpError(); |
|
72 | - } |
|
68 | + error_clear_last(); |
|
69 | + $result = \swoole_event_defer($callback); |
|
70 | + if ($result === false) { |
|
71 | + throw SwooleException::createFromPhpError(); |
|
72 | + } |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | */ |
83 | 83 | function swoole_event_del(int $fd): void |
84 | 84 | { |
85 | - error_clear_last(); |
|
86 | - $result = \swoole_event_del($fd); |
|
87 | - if ($result === false) { |
|
88 | - throw SwooleException::createFromPhpError(); |
|
89 | - } |
|
85 | + error_clear_last(); |
|
86 | + $result = \swoole_event_del($fd); |
|
87 | + if ($result === false) { |
|
88 | + throw SwooleException::createFromPhpError(); |
|
89 | + } |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | */ |
101 | 101 | function swoole_event_write(int $fd, string $data): void |
102 | 102 | { |
103 | - error_clear_last(); |
|
104 | - $result = \swoole_event_write($fd, $data); |
|
105 | - if ($result === false) { |
|
106 | - throw SwooleException::createFromPhpError(); |
|
107 | - } |
|
103 | + error_clear_last(); |
|
104 | + $result = \swoole_event_write($fd, $data); |
|
105 | + if ($result === false) { |
|
106 | + throw SwooleException::createFromPhpError(); |
|
107 | + } |
|
108 | 108 | } |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function odbc_autocommit($connection_id, bool $OnOff = false) |
28 | 28 | { |
29 | - error_clear_last(); |
|
30 | - $result = \odbc_autocommit($connection_id, $OnOff); |
|
31 | - if ($result === false) { |
|
32 | - throw UodbcException::createFromPhpError(); |
|
33 | - } |
|
34 | - return $result; |
|
29 | + error_clear_last(); |
|
30 | + $result = \odbc_autocommit($connection_id, $OnOff); |
|
31 | + if ($result === false) { |
|
32 | + throw UodbcException::createFromPhpError(); |
|
33 | + } |
|
34 | + return $result; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -136,11 +136,11 @@ discard block |
||
136 | 136 | */ |
137 | 137 | function odbc_binmode(int $result_id, int $mode): void |
138 | 138 | { |
139 | - error_clear_last(); |
|
140 | - $result = \odbc_binmode($result_id, $mode); |
|
141 | - if ($result === false) { |
|
142 | - throw UodbcException::createFromPhpError(); |
|
143 | - } |
|
139 | + error_clear_last(); |
|
140 | + $result = \odbc_binmode($result_id, $mode); |
|
141 | + if ($result === false) { |
|
142 | + throw UodbcException::createFromPhpError(); |
|
143 | + } |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
@@ -183,12 +183,12 @@ discard block |
||
183 | 183 | */ |
184 | 184 | function odbc_columnprivileges($connection_id, string $catalog, string $schema, string $table_name, string $column_name) |
185 | 185 | { |
186 | - error_clear_last(); |
|
187 | - $result = \odbc_columnprivileges($connection_id, $catalog, $schema, $table_name, $column_name); |
|
188 | - if ($result === false) { |
|
189 | - throw UodbcException::createFromPhpError(); |
|
190 | - } |
|
191 | - return $result; |
|
186 | + error_clear_last(); |
|
187 | + $result = \odbc_columnprivileges($connection_id, $catalog, $schema, $table_name, $column_name); |
|
188 | + if ($result === false) { |
|
189 | + throw UodbcException::createFromPhpError(); |
|
190 | + } |
|
191 | + return $result; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | |
@@ -239,22 +239,22 @@ discard block |
||
239 | 239 | */ |
240 | 240 | function odbc_columns($connection_id, string $catalog = null, string $schema = null, string $table_name = null, string $column_name = null) |
241 | 241 | { |
242 | - error_clear_last(); |
|
243 | - if ($column_name !== null) { |
|
244 | - $result = \odbc_columns($connection_id, $catalog, $schema, $table_name, $column_name); |
|
245 | - } elseif ($table_name !== null) { |
|
246 | - $result = \odbc_columns($connection_id, $catalog, $schema, $table_name); |
|
247 | - } elseif ($schema !== null) { |
|
248 | - $result = \odbc_columns($connection_id, $catalog, $schema); |
|
249 | - } elseif ($catalog !== null) { |
|
250 | - $result = \odbc_columns($connection_id, $catalog); |
|
251 | - } else { |
|
252 | - $result = \odbc_columns($connection_id); |
|
253 | - } |
|
254 | - if ($result === false) { |
|
255 | - throw UodbcException::createFromPhpError(); |
|
256 | - } |
|
257 | - return $result; |
|
242 | + error_clear_last(); |
|
243 | + if ($column_name !== null) { |
|
244 | + $result = \odbc_columns($connection_id, $catalog, $schema, $table_name, $column_name); |
|
245 | + } elseif ($table_name !== null) { |
|
246 | + $result = \odbc_columns($connection_id, $catalog, $schema, $table_name); |
|
247 | + } elseif ($schema !== null) { |
|
248 | + $result = \odbc_columns($connection_id, $catalog, $schema); |
|
249 | + } elseif ($catalog !== null) { |
|
250 | + $result = \odbc_columns($connection_id, $catalog); |
|
251 | + } else { |
|
252 | + $result = \odbc_columns($connection_id); |
|
253 | + } |
|
254 | + if ($result === false) { |
|
255 | + throw UodbcException::createFromPhpError(); |
|
256 | + } |
|
257 | + return $result; |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | |
@@ -268,11 +268,11 @@ discard block |
||
268 | 268 | */ |
269 | 269 | function odbc_commit($connection_id): void |
270 | 270 | { |
271 | - error_clear_last(); |
|
272 | - $result = \odbc_commit($connection_id); |
|
273 | - if ($result === false) { |
|
274 | - throw UodbcException::createFromPhpError(); |
|
275 | - } |
|
271 | + error_clear_last(); |
|
272 | + $result = \odbc_commit($connection_id); |
|
273 | + if ($result === false) { |
|
274 | + throw UodbcException::createFromPhpError(); |
|
275 | + } |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | |
@@ -293,12 +293,12 @@ discard block |
||
293 | 293 | */ |
294 | 294 | function odbc_data_source($connection_id, int $fetch_type): array |
295 | 295 | { |
296 | - error_clear_last(); |
|
297 | - $result = \odbc_data_source($connection_id, $fetch_type); |
|
298 | - if ($result === false) { |
|
299 | - throw UodbcException::createFromPhpError(); |
|
300 | - } |
|
301 | - return $result; |
|
296 | + error_clear_last(); |
|
297 | + $result = \odbc_data_source($connection_id, $fetch_type); |
|
298 | + if ($result === false) { |
|
299 | + throw UodbcException::createFromPhpError(); |
|
300 | + } |
|
301 | + return $result; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | |
@@ -316,16 +316,16 @@ discard block |
||
316 | 316 | */ |
317 | 317 | function odbc_exec($connection_id, string $query_string, int $flags = null) |
318 | 318 | { |
319 | - error_clear_last(); |
|
320 | - if ($flags !== null) { |
|
321 | - $result = \odbc_exec($connection_id, $query_string, $flags); |
|
322 | - } else { |
|
323 | - $result = \odbc_exec($connection_id, $query_string); |
|
324 | - } |
|
325 | - if ($result === false) { |
|
326 | - throw UodbcException::createFromPhpError(); |
|
327 | - } |
|
328 | - return $result; |
|
319 | + error_clear_last(); |
|
320 | + if ($flags !== null) { |
|
321 | + $result = \odbc_exec($connection_id, $query_string, $flags); |
|
322 | + } else { |
|
323 | + $result = \odbc_exec($connection_id, $query_string); |
|
324 | + } |
|
325 | + if ($result === false) { |
|
326 | + throw UodbcException::createFromPhpError(); |
|
327 | + } |
|
328 | + return $result; |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | |
@@ -347,15 +347,15 @@ discard block |
||
347 | 347 | */ |
348 | 348 | function odbc_execute($result_id, array $parameters_array = null): void |
349 | 349 | { |
350 | - error_clear_last(); |
|
351 | - if ($parameters_array !== null) { |
|
352 | - $result = \odbc_execute($result_id, $parameters_array); |
|
353 | - } else { |
|
354 | - $result = \odbc_execute($result_id); |
|
355 | - } |
|
356 | - if ($result === false) { |
|
357 | - throw UodbcException::createFromPhpError(); |
|
358 | - } |
|
350 | + error_clear_last(); |
|
351 | + if ($parameters_array !== null) { |
|
352 | + $result = \odbc_execute($result_id, $parameters_array); |
|
353 | + } else { |
|
354 | + $result = \odbc_execute($result_id); |
|
355 | + } |
|
356 | + if ($result === false) { |
|
357 | + throw UodbcException::createFromPhpError(); |
|
358 | + } |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | |
@@ -375,16 +375,16 @@ discard block |
||
375 | 375 | */ |
376 | 376 | function odbc_fetch_into($result_id, ?array &$result_array, int $rownumber = null): int |
377 | 377 | { |
378 | - error_clear_last(); |
|
379 | - if ($rownumber !== null) { |
|
380 | - $result = \odbc_fetch_into($result_id, $result_array, $rownumber); |
|
381 | - } else { |
|
382 | - $result = \odbc_fetch_into($result_id, $result_array); |
|
383 | - } |
|
384 | - if ($result === false) { |
|
385 | - throw UodbcException::createFromPhpError(); |
|
386 | - } |
|
387 | - return $result; |
|
378 | + error_clear_last(); |
|
379 | + if ($rownumber !== null) { |
|
380 | + $result = \odbc_fetch_into($result_id, $result_array, $rownumber); |
|
381 | + } else { |
|
382 | + $result = \odbc_fetch_into($result_id, $result_array); |
|
383 | + } |
|
384 | + if ($result === false) { |
|
385 | + throw UodbcException::createFromPhpError(); |
|
386 | + } |
|
387 | + return $result; |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | |
@@ -400,12 +400,12 @@ discard block |
||
400 | 400 | */ |
401 | 401 | function odbc_field_len($result_id, int $field_number): int |
402 | 402 | { |
403 | - error_clear_last(); |
|
404 | - $result = \odbc_field_len($result_id, $field_number); |
|
405 | - if ($result === false) { |
|
406 | - throw UodbcException::createFromPhpError(); |
|
407 | - } |
|
408 | - return $result; |
|
403 | + error_clear_last(); |
|
404 | + $result = \odbc_field_len($result_id, $field_number); |
|
405 | + if ($result === false) { |
|
406 | + throw UodbcException::createFromPhpError(); |
|
407 | + } |
|
408 | + return $result; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | |
@@ -421,12 +421,12 @@ discard block |
||
421 | 421 | */ |
422 | 422 | function odbc_field_name($result_id, int $field_number): string |
423 | 423 | { |
424 | - error_clear_last(); |
|
425 | - $result = \odbc_field_name($result_id, $field_number); |
|
426 | - if ($result === false) { |
|
427 | - throw UodbcException::createFromPhpError(); |
|
428 | - } |
|
429 | - return $result; |
|
424 | + error_clear_last(); |
|
425 | + $result = \odbc_field_name($result_id, $field_number); |
|
426 | + if ($result === false) { |
|
427 | + throw UodbcException::createFromPhpError(); |
|
428 | + } |
|
429 | + return $result; |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | |
@@ -443,12 +443,12 @@ discard block |
||
443 | 443 | */ |
444 | 444 | function odbc_field_num($result_id, string $field_name): int |
445 | 445 | { |
446 | - error_clear_last(); |
|
447 | - $result = \odbc_field_num($result_id, $field_name); |
|
448 | - if ($result === false) { |
|
449 | - throw UodbcException::createFromPhpError(); |
|
450 | - } |
|
451 | - return $result; |
|
446 | + error_clear_last(); |
|
447 | + $result = \odbc_field_num($result_id, $field_name); |
|
448 | + if ($result === false) { |
|
449 | + throw UodbcException::createFromPhpError(); |
|
450 | + } |
|
451 | + return $result; |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | |
@@ -464,12 +464,12 @@ discard block |
||
464 | 464 | */ |
465 | 465 | function odbc_field_scale($result_id, int $field_number): int |
466 | 466 | { |
467 | - error_clear_last(); |
|
468 | - $result = \odbc_field_scale($result_id, $field_number); |
|
469 | - if ($result === false) { |
|
470 | - throw UodbcException::createFromPhpError(); |
|
471 | - } |
|
472 | - return $result; |
|
467 | + error_clear_last(); |
|
468 | + $result = \odbc_field_scale($result_id, $field_number); |
|
469 | + if ($result === false) { |
|
470 | + throw UodbcException::createFromPhpError(); |
|
471 | + } |
|
472 | + return $result; |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | |
@@ -485,12 +485,12 @@ discard block |
||
485 | 485 | */ |
486 | 486 | function odbc_field_type($result_id, int $field_number): string |
487 | 487 | { |
488 | - error_clear_last(); |
|
489 | - $result = \odbc_field_type($result_id, $field_number); |
|
490 | - if ($result === false) { |
|
491 | - throw UodbcException::createFromPhpError(); |
|
492 | - } |
|
493 | - return $result; |
|
488 | + error_clear_last(); |
|
489 | + $result = \odbc_field_type($result_id, $field_number); |
|
490 | + if ($result === false) { |
|
491 | + throw UodbcException::createFromPhpError(); |
|
492 | + } |
|
493 | + return $result; |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | |
@@ -532,12 +532,12 @@ discard block |
||
532 | 532 | */ |
533 | 533 | function odbc_foreignkeys($connection_id, string $pk_catalog, string $pk_schema, string $pk_table, string $fk_catalog, string $fk_schema, string $fk_table) |
534 | 534 | { |
535 | - error_clear_last(); |
|
536 | - $result = \odbc_foreignkeys($connection_id, $pk_catalog, $pk_schema, $pk_table, $fk_catalog, $fk_schema, $fk_table); |
|
537 | - if ($result === false) { |
|
538 | - throw UodbcException::createFromPhpError(); |
|
539 | - } |
|
540 | - return $result; |
|
535 | + error_clear_last(); |
|
536 | + $result = \odbc_foreignkeys($connection_id, $pk_catalog, $pk_schema, $pk_table, $fk_catalog, $fk_schema, $fk_table); |
|
537 | + if ($result === false) { |
|
538 | + throw UodbcException::createFromPhpError(); |
|
539 | + } |
|
540 | + return $result; |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | |
@@ -575,16 +575,16 @@ discard block |
||
575 | 575 | */ |
576 | 576 | function odbc_gettypeinfo($connection_id, int $data_type = null) |
577 | 577 | { |
578 | - error_clear_last(); |
|
579 | - if ($data_type !== null) { |
|
580 | - $result = \odbc_gettypeinfo($connection_id, $data_type); |
|
581 | - } else { |
|
582 | - $result = \odbc_gettypeinfo($connection_id); |
|
583 | - } |
|
584 | - if ($result === false) { |
|
585 | - throw UodbcException::createFromPhpError(); |
|
586 | - } |
|
587 | - return $result; |
|
578 | + error_clear_last(); |
|
579 | + if ($data_type !== null) { |
|
580 | + $result = \odbc_gettypeinfo($connection_id, $data_type); |
|
581 | + } else { |
|
582 | + $result = \odbc_gettypeinfo($connection_id); |
|
583 | + } |
|
584 | + if ($result === false) { |
|
585 | + throw UodbcException::createFromPhpError(); |
|
586 | + } |
|
587 | + return $result; |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | |
@@ -602,11 +602,11 @@ discard block |
||
602 | 602 | */ |
603 | 603 | function odbc_longreadlen($result_id, int $length): void |
604 | 604 | { |
605 | - error_clear_last(); |
|
606 | - $result = \odbc_longreadlen($result_id, $length); |
|
607 | - if ($result === false) { |
|
608 | - throw UodbcException::createFromPhpError(); |
|
609 | - } |
|
605 | + error_clear_last(); |
|
606 | + $result = \odbc_longreadlen($result_id, $length); |
|
607 | + if ($result === false) { |
|
608 | + throw UodbcException::createFromPhpError(); |
|
609 | + } |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | |
@@ -629,12 +629,12 @@ discard block |
||
629 | 629 | */ |
630 | 630 | function odbc_prepare($connection_id, string $query_string) |
631 | 631 | { |
632 | - error_clear_last(); |
|
633 | - $result = \odbc_prepare($connection_id, $query_string); |
|
634 | - if ($result === false) { |
|
635 | - throw UodbcException::createFromPhpError(); |
|
636 | - } |
|
637 | - return $result; |
|
632 | + error_clear_last(); |
|
633 | + $result = \odbc_prepare($connection_id, $query_string); |
|
634 | + if ($result === false) { |
|
635 | + throw UodbcException::createFromPhpError(); |
|
636 | + } |
|
637 | + return $result; |
|
638 | 638 | } |
639 | 639 | |
640 | 640 | |
@@ -664,12 +664,12 @@ discard block |
||
664 | 664 | */ |
665 | 665 | function odbc_primarykeys($connection_id, string $catalog, string $schema, string $table) |
666 | 666 | { |
667 | - error_clear_last(); |
|
668 | - $result = \odbc_primarykeys($connection_id, $catalog, $schema, $table); |
|
669 | - if ($result === false) { |
|
670 | - throw UodbcException::createFromPhpError(); |
|
671 | - } |
|
672 | - return $result; |
|
667 | + error_clear_last(); |
|
668 | + $result = \odbc_primarykeys($connection_id, $catalog, $schema, $table); |
|
669 | + if ($result === false) { |
|
670 | + throw UodbcException::createFromPhpError(); |
|
671 | + } |
|
672 | + return $result; |
|
673 | 673 | } |
674 | 674 | |
675 | 675 | |
@@ -689,16 +689,16 @@ discard block |
||
689 | 689 | */ |
690 | 690 | function odbc_result_all($result_id, string $format = null): int |
691 | 691 | { |
692 | - error_clear_last(); |
|
693 | - if ($format !== null) { |
|
694 | - $result = \odbc_result_all($result_id, $format); |
|
695 | - } else { |
|
696 | - $result = \odbc_result_all($result_id); |
|
697 | - } |
|
698 | - if ($result === false) { |
|
699 | - throw UodbcException::createFromPhpError(); |
|
700 | - } |
|
701 | - return $result; |
|
692 | + error_clear_last(); |
|
693 | + if ($format !== null) { |
|
694 | + $result = \odbc_result_all($result_id, $format); |
|
695 | + } else { |
|
696 | + $result = \odbc_result_all($result_id); |
|
697 | + } |
|
698 | + if ($result === false) { |
|
699 | + throw UodbcException::createFromPhpError(); |
|
700 | + } |
|
701 | + return $result; |
|
702 | 702 | } |
703 | 703 | |
704 | 704 | |
@@ -716,12 +716,12 @@ discard block |
||
716 | 716 | */ |
717 | 717 | function odbc_result($result_id, $field) |
718 | 718 | { |
719 | - error_clear_last(); |
|
720 | - $result = \odbc_result($result_id, $field); |
|
721 | - if ($result === false) { |
|
722 | - throw UodbcException::createFromPhpError(); |
|
723 | - } |
|
724 | - return $result; |
|
719 | + error_clear_last(); |
|
720 | + $result = \odbc_result($result_id, $field); |
|
721 | + if ($result === false) { |
|
722 | + throw UodbcException::createFromPhpError(); |
|
723 | + } |
|
724 | + return $result; |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | |
@@ -735,11 +735,11 @@ discard block |
||
735 | 735 | */ |
736 | 736 | function odbc_rollback($connection_id): void |
737 | 737 | { |
738 | - error_clear_last(); |
|
739 | - $result = \odbc_rollback($connection_id); |
|
740 | - if ($result === false) { |
|
741 | - throw UodbcException::createFromPhpError(); |
|
742 | - } |
|
738 | + error_clear_last(); |
|
739 | + $result = \odbc_rollback($connection_id); |
|
740 | + if ($result === false) { |
|
741 | + throw UodbcException::createFromPhpError(); |
|
742 | + } |
|
743 | 743 | } |
744 | 744 | |
745 | 745 | |
@@ -775,11 +775,11 @@ discard block |
||
775 | 775 | */ |
776 | 776 | function odbc_setoption($id, int $function, int $option, int $param): void |
777 | 777 | { |
778 | - error_clear_last(); |
|
779 | - $result = \odbc_setoption($id, $function, $option, $param); |
|
780 | - if ($result === false) { |
|
781 | - throw UodbcException::createFromPhpError(); |
|
782 | - } |
|
778 | + error_clear_last(); |
|
779 | + $result = \odbc_setoption($id, $function, $option, $param); |
|
780 | + if ($result === false) { |
|
781 | + throw UodbcException::createFromPhpError(); |
|
782 | + } |
|
783 | 783 | } |
784 | 784 | |
785 | 785 | |
@@ -818,12 +818,12 @@ discard block |
||
818 | 818 | */ |
819 | 819 | function odbc_specialcolumns($connection_id, int $type, string $catalog, string $schema, string $table, int $scope, int $nullable) |
820 | 820 | { |
821 | - error_clear_last(); |
|
822 | - $result = \odbc_specialcolumns($connection_id, $type, $catalog, $schema, $table, $scope, $nullable); |
|
823 | - if ($result === false) { |
|
824 | - throw UodbcException::createFromPhpError(); |
|
825 | - } |
|
826 | - return $result; |
|
821 | + error_clear_last(); |
|
822 | + $result = \odbc_specialcolumns($connection_id, $type, $catalog, $schema, $table, $scope, $nullable); |
|
823 | + if ($result === false) { |
|
824 | + throw UodbcException::createFromPhpError(); |
|
825 | + } |
|
826 | + return $result; |
|
827 | 827 | } |
828 | 828 | |
829 | 829 | |
@@ -864,12 +864,12 @@ discard block |
||
864 | 864 | */ |
865 | 865 | function odbc_statistics($connection_id, string $catalog, string $schema, string $table_name, int $unique, int $accuracy) |
866 | 866 | { |
867 | - error_clear_last(); |
|
868 | - $result = \odbc_statistics($connection_id, $catalog, $schema, $table_name, $unique, $accuracy); |
|
869 | - if ($result === false) { |
|
870 | - throw UodbcException::createFromPhpError(); |
|
871 | - } |
|
872 | - return $result; |
|
867 | + error_clear_last(); |
|
868 | + $result = \odbc_statistics($connection_id, $catalog, $schema, $table_name, $unique, $accuracy); |
|
869 | + if ($result === false) { |
|
870 | + throw UodbcException::createFromPhpError(); |
|
871 | + } |
|
872 | + return $result; |
|
873 | 873 | } |
874 | 874 | |
875 | 875 | |
@@ -906,12 +906,12 @@ discard block |
||
906 | 906 | */ |
907 | 907 | function odbc_tableprivileges($connection_id, string $catalog, string $schema, string $name) |
908 | 908 | { |
909 | - error_clear_last(); |
|
910 | - $result = \odbc_tableprivileges($connection_id, $catalog, $schema, $name); |
|
911 | - if ($result === false) { |
|
912 | - throw UodbcException::createFromPhpError(); |
|
913 | - } |
|
914 | - return $result; |
|
909 | + error_clear_last(); |
|
910 | + $result = \odbc_tableprivileges($connection_id, $catalog, $schema, $name); |
|
911 | + if ($result === false) { |
|
912 | + throw UodbcException::createFromPhpError(); |
|
913 | + } |
|
914 | + return $result; |
|
915 | 915 | } |
916 | 916 | |
917 | 917 | |
@@ -990,20 +990,20 @@ discard block |
||
990 | 990 | */ |
991 | 991 | function odbc_tables($connection_id, string $catalog = null, string $schema = null, string $name = null, string $types = null) |
992 | 992 | { |
993 | - error_clear_last(); |
|
994 | - if ($types !== null) { |
|
995 | - $result = \odbc_tables($connection_id, $catalog, $schema, $name, $types); |
|
996 | - } elseif ($name !== null) { |
|
997 | - $result = \odbc_tables($connection_id, $catalog, $schema, $name); |
|
998 | - } elseif ($schema !== null) { |
|
999 | - $result = \odbc_tables($connection_id, $catalog, $schema); |
|
1000 | - } elseif ($catalog !== null) { |
|
1001 | - $result = \odbc_tables($connection_id, $catalog); |
|
1002 | - } else { |
|
1003 | - $result = \odbc_tables($connection_id); |
|
1004 | - } |
|
1005 | - if ($result === false) { |
|
1006 | - throw UodbcException::createFromPhpError(); |
|
1007 | - } |
|
1008 | - return $result; |
|
993 | + error_clear_last(); |
|
994 | + if ($types !== null) { |
|
995 | + $result = \odbc_tables($connection_id, $catalog, $schema, $name, $types); |
|
996 | + } elseif ($name !== null) { |
|
997 | + $result = \odbc_tables($connection_id, $catalog, $schema, $name); |
|
998 | + } elseif ($schema !== null) { |
|
999 | + $result = \odbc_tables($connection_id, $catalog, $schema); |
|
1000 | + } elseif ($catalog !== null) { |
|
1001 | + $result = \odbc_tables($connection_id, $catalog); |
|
1002 | + } else { |
|
1003 | + $result = \odbc_tables($connection_id); |
|
1004 | + } |
|
1005 | + if ($result === false) { |
|
1006 | + throw UodbcException::createFromPhpError(); |
|
1007 | + } |
|
1008 | + return $result; |
|
1009 | 1009 | } |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function gnupg_adddecryptkey($identifier, string $fingerprint, string $passphrase): void |
18 | 18 | { |
19 | - error_clear_last(); |
|
20 | - $result = \gnupg_adddecryptkey($identifier, $fingerprint, $passphrase); |
|
21 | - if ($result === false) { |
|
22 | - throw GnupgException::createFromPhpError(); |
|
23 | - } |
|
19 | + error_clear_last(); |
|
20 | + $result = \gnupg_adddecryptkey($identifier, $fingerprint, $passphrase); |
|
21 | + if ($result === false) { |
|
22 | + throw GnupgException::createFromPhpError(); |
|
23 | + } |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function gnupg_addencryptkey($identifier, string $fingerprint): void |
37 | 37 | { |
38 | - error_clear_last(); |
|
39 | - $result = \gnupg_addencryptkey($identifier, $fingerprint); |
|
40 | - if ($result === false) { |
|
41 | - throw GnupgException::createFromPhpError(); |
|
42 | - } |
|
38 | + error_clear_last(); |
|
39 | + $result = \gnupg_addencryptkey($identifier, $fingerprint); |
|
40 | + if ($result === false) { |
|
41 | + throw GnupgException::createFromPhpError(); |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function gnupg_addsignkey($identifier, string $fingerprint, string $passphrase = null): void |
57 | 57 | { |
58 | - error_clear_last(); |
|
59 | - if ($passphrase !== null) { |
|
60 | - $result = \gnupg_addsignkey($identifier, $fingerprint, $passphrase); |
|
61 | - } else { |
|
62 | - $result = \gnupg_addsignkey($identifier, $fingerprint); |
|
63 | - } |
|
64 | - if ($result === false) { |
|
65 | - throw GnupgException::createFromPhpError(); |
|
66 | - } |
|
58 | + error_clear_last(); |
|
59 | + if ($passphrase !== null) { |
|
60 | + $result = \gnupg_addsignkey($identifier, $fingerprint, $passphrase); |
|
61 | + } else { |
|
62 | + $result = \gnupg_addsignkey($identifier, $fingerprint); |
|
63 | + } |
|
64 | + if ($result === false) { |
|
65 | + throw GnupgException::createFromPhpError(); |
|
66 | + } |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | */ |
78 | 78 | function gnupg_cleardecryptkeys($identifier): void |
79 | 79 | { |
80 | - error_clear_last(); |
|
81 | - $result = \gnupg_cleardecryptkeys($identifier); |
|
82 | - if ($result === false) { |
|
83 | - throw GnupgException::createFromPhpError(); |
|
84 | - } |
|
80 | + error_clear_last(); |
|
81 | + $result = \gnupg_cleardecryptkeys($identifier); |
|
82 | + if ($result === false) { |
|
83 | + throw GnupgException::createFromPhpError(); |
|
84 | + } |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function gnupg_clearencryptkeys($identifier): void |
97 | 97 | { |
98 | - error_clear_last(); |
|
99 | - $result = \gnupg_clearencryptkeys($identifier); |
|
100 | - if ($result === false) { |
|
101 | - throw GnupgException::createFromPhpError(); |
|
102 | - } |
|
98 | + error_clear_last(); |
|
99 | + $result = \gnupg_clearencryptkeys($identifier); |
|
100 | + if ($result === false) { |
|
101 | + throw GnupgException::createFromPhpError(); |
|
102 | + } |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | */ |
114 | 114 | function gnupg_clearsignkeys($identifier): void |
115 | 115 | { |
116 | - error_clear_last(); |
|
117 | - $result = \gnupg_clearsignkeys($identifier); |
|
118 | - if ($result === false) { |
|
119 | - throw GnupgException::createFromPhpError(); |
|
120 | - } |
|
116 | + error_clear_last(); |
|
117 | + $result = \gnupg_clearsignkeys($identifier); |
|
118 | + if ($result === false) { |
|
119 | + throw GnupgException::createFromPhpError(); |
|
120 | + } |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | */ |
135 | 135 | function gnupg_setarmor($identifier, int $armor): void |
136 | 136 | { |
137 | - error_clear_last(); |
|
138 | - $result = \gnupg_setarmor($identifier, $armor); |
|
139 | - if ($result === false) { |
|
140 | - throw GnupgException::createFromPhpError(); |
|
141 | - } |
|
137 | + error_clear_last(); |
|
138 | + $result = \gnupg_setarmor($identifier, $armor); |
|
139 | + if ($result === false) { |
|
140 | + throw GnupgException::createFromPhpError(); |
|
141 | + } |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | */ |
161 | 161 | function gnupg_setsignmode($identifier, int $signmode): void |
162 | 162 | { |
163 | - error_clear_last(); |
|
164 | - $result = \gnupg_setsignmode($identifier, $signmode); |
|
165 | - if ($result === false) { |
|
166 | - throw GnupgException::createFromPhpError(); |
|
167 | - } |
|
163 | + error_clear_last(); |
|
164 | + $result = \gnupg_setsignmode($identifier, $signmode); |
|
165 | + if ($result === false) { |
|
166 | + throw GnupgException::createFromPhpError(); |
|
167 | + } |
|
168 | 168 | } |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | */ |
14 | 14 | function msg_queue_exists(int $key): void |
15 | 15 | { |
16 | - error_clear_last(); |
|
17 | - $result = \msg_queue_exists($key); |
|
18 | - if ($result === false) { |
|
19 | - throw SemException::createFromPhpError(); |
|
20 | - } |
|
16 | + error_clear_last(); |
|
17 | + $result = \msg_queue_exists($key); |
|
18 | + if ($result === false) { |
|
19 | + throw SemException::createFromPhpError(); |
|
20 | + } |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | */ |
95 | 95 | function msg_receive($queue, int $desiredmsgtype, ?int &$msgtype, int $maxsize, &$message, bool $unserialize = true, int $flags = 0, ?int &$errorcode = null): void |
96 | 96 | { |
97 | - error_clear_last(); |
|
98 | - $result = \msg_receive($queue, $desiredmsgtype, $msgtype, $maxsize, $message, $unserialize, $flags, $errorcode); |
|
99 | - if ($result === false) { |
|
100 | - throw SemException::createFromPhpError(); |
|
101 | - } |
|
97 | + error_clear_last(); |
|
98 | + $result = \msg_receive($queue, $desiredmsgtype, $msgtype, $maxsize, $message, $unserialize, $flags, $errorcode); |
|
99 | + if ($result === false) { |
|
100 | + throw SemException::createFromPhpError(); |
|
101 | + } |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | */ |
115 | 115 | function msg_remove_queue($queue): void |
116 | 116 | { |
117 | - error_clear_last(); |
|
118 | - $result = \msg_remove_queue($queue); |
|
119 | - if ($result === false) { |
|
120 | - throw SemException::createFromPhpError(); |
|
121 | - } |
|
117 | + error_clear_last(); |
|
118 | + $result = \msg_remove_queue($queue); |
|
119 | + if ($result === false) { |
|
120 | + throw SemException::createFromPhpError(); |
|
121 | + } |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
@@ -157,11 +157,11 @@ discard block |
||
157 | 157 | */ |
158 | 158 | function msg_send($queue, int $msgtype, $message, bool $serialize = true, bool $blocking = true, ?int &$errorcode = null): void |
159 | 159 | { |
160 | - error_clear_last(); |
|
161 | - $result = \msg_send($queue, $msgtype, $message, $serialize, $blocking, $errorcode); |
|
162 | - if ($result === false) { |
|
163 | - throw SemException::createFromPhpError(); |
|
164 | - } |
|
160 | + error_clear_last(); |
|
161 | + $result = \msg_send($queue, $msgtype, $message, $serialize, $blocking, $errorcode); |
|
162 | + if ($result === false) { |
|
163 | + throw SemException::createFromPhpError(); |
|
164 | + } |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | */ |
185 | 185 | function msg_set_queue($queue, array $data): void |
186 | 186 | { |
187 | - error_clear_last(); |
|
188 | - $result = \msg_set_queue($queue, $data); |
|
189 | - if ($result === false) { |
|
190 | - throw SemException::createFromPhpError(); |
|
191 | - } |
|
187 | + error_clear_last(); |
|
188 | + $result = \msg_set_queue($queue, $data); |
|
189 | + if ($result === false) { |
|
190 | + throw SemException::createFromPhpError(); |
|
191 | + } |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | |
@@ -213,11 +213,11 @@ discard block |
||
213 | 213 | */ |
214 | 214 | function sem_acquire($sem_identifier, bool $nowait = false): void |
215 | 215 | { |
216 | - error_clear_last(); |
|
217 | - $result = \sem_acquire($sem_identifier, $nowait); |
|
218 | - if ($result === false) { |
|
219 | - throw SemException::createFromPhpError(); |
|
220 | - } |
|
216 | + error_clear_last(); |
|
217 | + $result = \sem_acquire($sem_identifier, $nowait); |
|
218 | + if ($result === false) { |
|
219 | + throw SemException::createFromPhpError(); |
|
220 | + } |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | |
@@ -246,12 +246,12 @@ discard block |
||
246 | 246 | */ |
247 | 247 | function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_release = 1) |
248 | 248 | { |
249 | - error_clear_last(); |
|
250 | - $result = \sem_get($key, $max_acquire, $perm, $auto_release); |
|
251 | - if ($result === false) { |
|
252 | - throw SemException::createFromPhpError(); |
|
253 | - } |
|
254 | - return $result; |
|
249 | + error_clear_last(); |
|
250 | + $result = \sem_get($key, $max_acquire, $perm, $auto_release); |
|
251 | + if ($result === false) { |
|
252 | + throw SemException::createFromPhpError(); |
|
253 | + } |
|
254 | + return $result; |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | */ |
271 | 271 | function sem_release($sem_identifier): void |
272 | 272 | { |
273 | - error_clear_last(); |
|
274 | - $result = \sem_release($sem_identifier); |
|
275 | - if ($result === false) { |
|
276 | - throw SemException::createFromPhpError(); |
|
277 | - } |
|
273 | + error_clear_last(); |
|
274 | + $result = \sem_release($sem_identifier); |
|
275 | + if ($result === false) { |
|
276 | + throw SemException::createFromPhpError(); |
|
277 | + } |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | |
@@ -290,11 +290,11 @@ discard block |
||
290 | 290 | */ |
291 | 291 | function sem_remove($sem_identifier): void |
292 | 292 | { |
293 | - error_clear_last(); |
|
294 | - $result = \sem_remove($sem_identifier); |
|
295 | - if ($result === false) { |
|
296 | - throw SemException::createFromPhpError(); |
|
297 | - } |
|
293 | + error_clear_last(); |
|
294 | + $result = \sem_remove($sem_identifier); |
|
295 | + if ($result === false) { |
|
296 | + throw SemException::createFromPhpError(); |
|
297 | + } |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -320,11 +320,11 @@ discard block |
||
320 | 320 | */ |
321 | 321 | function shm_put_var($shm_identifier, int $variable_key, $variable): void |
322 | 322 | { |
323 | - error_clear_last(); |
|
324 | - $result = \shm_put_var($shm_identifier, $variable_key, $variable); |
|
325 | - if ($result === false) { |
|
326 | - throw SemException::createFromPhpError(); |
|
327 | - } |
|
323 | + error_clear_last(); |
|
324 | + $result = \shm_put_var($shm_identifier, $variable_key, $variable); |
|
325 | + if ($result === false) { |
|
326 | + throw SemException::createFromPhpError(); |
|
327 | + } |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | */ |
341 | 341 | function shm_remove_var($shm_identifier, int $variable_key): void |
342 | 342 | { |
343 | - error_clear_last(); |
|
344 | - $result = \shm_remove_var($shm_identifier, $variable_key); |
|
345 | - if ($result === false) { |
|
346 | - throw SemException::createFromPhpError(); |
|
347 | - } |
|
343 | + error_clear_last(); |
|
344 | + $result = \shm_remove_var($shm_identifier, $variable_key); |
|
345 | + if ($result === false) { |
|
346 | + throw SemException::createFromPhpError(); |
|
347 | + } |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | |
@@ -359,9 +359,9 @@ discard block |
||
359 | 359 | */ |
360 | 360 | function shm_remove($shm_identifier): void |
361 | 361 | { |
362 | - error_clear_last(); |
|
363 | - $result = \shm_remove($shm_identifier); |
|
364 | - if ($result === false) { |
|
365 | - throw SemException::createFromPhpError(); |
|
366 | - } |
|
362 | + error_clear_last(); |
|
363 | + $result = \shm_remove($shm_identifier); |
|
364 | + if ($result === false) { |
|
365 | + throw SemException::createFromPhpError(); |
|
366 | + } |
|
367 | 367 | } |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function deflate_add($context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH): string |
26 | 26 | { |
27 | - error_clear_last(); |
|
28 | - $result = \deflate_add($context, $data, $flush_mode); |
|
29 | - if ($result === false) { |
|
30 | - throw ZlibException::createFromPhpError(); |
|
31 | - } |
|
32 | - return $result; |
|
27 | + error_clear_last(); |
|
28 | + $result = \deflate_add($context, $data, $flush_mode); |
|
29 | + if ($result === false) { |
|
30 | + throw ZlibException::createFromPhpError(); |
|
31 | + } |
|
32 | + return $result; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | */ |
118 | 118 | function deflate_init(int $encoding, array $options = null) |
119 | 119 | { |
120 | - error_clear_last(); |
|
121 | - $result = \deflate_init($encoding, $options); |
|
122 | - if ($result === false) { |
|
123 | - throw ZlibException::createFromPhpError(); |
|
124 | - } |
|
125 | - return $result; |
|
120 | + error_clear_last(); |
|
121 | + $result = \deflate_init($encoding, $options); |
|
122 | + if ($result === false) { |
|
123 | + throw ZlibException::createFromPhpError(); |
|
124 | + } |
|
125 | + return $result; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | |
@@ -136,11 +136,11 @@ discard block |
||
136 | 136 | */ |
137 | 137 | function gzclose($zp): void |
138 | 138 | { |
139 | - error_clear_last(); |
|
140 | - $result = \gzclose($zp); |
|
141 | - if ($result === false) { |
|
142 | - throw ZlibException::createFromPhpError(); |
|
143 | - } |
|
139 | + error_clear_last(); |
|
140 | + $result = \gzclose($zp); |
|
141 | + if ($result === false) { |
|
142 | + throw ZlibException::createFromPhpError(); |
|
143 | + } |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | */ |
165 | 165 | function gzcompress(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_DEFLATE): string |
166 | 166 | { |
167 | - error_clear_last(); |
|
168 | - $result = \gzcompress($data, $level, $encoding); |
|
169 | - if ($result === false) { |
|
170 | - throw ZlibException::createFromPhpError(); |
|
171 | - } |
|
172 | - return $result; |
|
167 | + error_clear_last(); |
|
168 | + $result = \gzcompress($data, $level, $encoding); |
|
169 | + if ($result === false) { |
|
170 | + throw ZlibException::createFromPhpError(); |
|
171 | + } |
|
172 | + return $result; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | |
@@ -185,16 +185,16 @@ discard block |
||
185 | 185 | */ |
186 | 186 | function gzdecode(string $data, int $length = null): string |
187 | 187 | { |
188 | - error_clear_last(); |
|
189 | - if ($length !== null) { |
|
190 | - $result = \gzdecode($data, $length); |
|
191 | - } else { |
|
192 | - $result = \gzdecode($data); |
|
193 | - } |
|
194 | - if ($result === false) { |
|
195 | - throw ZlibException::createFromPhpError(); |
|
196 | - } |
|
197 | - return $result; |
|
188 | + error_clear_last(); |
|
189 | + if ($length !== null) { |
|
190 | + $result = \gzdecode($data, $length); |
|
191 | + } else { |
|
192 | + $result = \gzdecode($data); |
|
193 | + } |
|
194 | + if ($result === false) { |
|
195 | + throw ZlibException::createFromPhpError(); |
|
196 | + } |
|
197 | + return $result; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | |
@@ -217,12 +217,12 @@ discard block |
||
217 | 217 | */ |
218 | 218 | function gzdeflate(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_RAW): string |
219 | 219 | { |
220 | - error_clear_last(); |
|
221 | - $result = \gzdeflate($data, $level, $encoding); |
|
222 | - if ($result === false) { |
|
223 | - throw ZlibException::createFromPhpError(); |
|
224 | - } |
|
225 | - return $result; |
|
220 | + error_clear_last(); |
|
221 | + $result = \gzdeflate($data, $level, $encoding); |
|
222 | + if ($result === false) { |
|
223 | + throw ZlibException::createFromPhpError(); |
|
224 | + } |
|
225 | + return $result; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -255,12 +255,12 @@ discard block |
||
255 | 255 | */ |
256 | 256 | function gzencode(string $data, int $level = -1, int $encoding_mode = FORCE_GZIP): string |
257 | 257 | { |
258 | - error_clear_last(); |
|
259 | - $result = \gzencode($data, $level, $encoding_mode); |
|
260 | - if ($result === false) { |
|
261 | - throw ZlibException::createFromPhpError(); |
|
262 | - } |
|
263 | - return $result; |
|
258 | + error_clear_last(); |
|
259 | + $result = \gzencode($data, $level, $encoding_mode); |
|
260 | + if ($result === false) { |
|
261 | + throw ZlibException::createFromPhpError(); |
|
262 | + } |
|
263 | + return $result; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | |
@@ -278,16 +278,16 @@ discard block |
||
278 | 278 | */ |
279 | 279 | function gzgets($zp, int $length = null): string |
280 | 280 | { |
281 | - error_clear_last(); |
|
282 | - if ($length !== null) { |
|
283 | - $result = \gzgets($zp, $length); |
|
284 | - } else { |
|
285 | - $result = \gzgets($zp); |
|
286 | - } |
|
287 | - if ($result === false) { |
|
288 | - throw ZlibException::createFromPhpError(); |
|
289 | - } |
|
290 | - return $result; |
|
281 | + error_clear_last(); |
|
282 | + if ($length !== null) { |
|
283 | + $result = \gzgets($zp, $length); |
|
284 | + } else { |
|
285 | + $result = \gzgets($zp); |
|
286 | + } |
|
287 | + if ($result === false) { |
|
288 | + throw ZlibException::createFromPhpError(); |
|
289 | + } |
|
290 | + return $result; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | |
@@ -307,16 +307,16 @@ discard block |
||
307 | 307 | */ |
308 | 308 | function gzgetss($zp, int $length, string $allowable_tags = null): string |
309 | 309 | { |
310 | - error_clear_last(); |
|
311 | - if ($allowable_tags !== null) { |
|
312 | - $result = \gzgetss($zp, $length, $allowable_tags); |
|
313 | - } else { |
|
314 | - $result = \gzgetss($zp, $length); |
|
315 | - } |
|
316 | - if ($result === false) { |
|
317 | - throw ZlibException::createFromPhpError(); |
|
318 | - } |
|
319 | - return $result; |
|
310 | + error_clear_last(); |
|
311 | + if ($allowable_tags !== null) { |
|
312 | + $result = \gzgetss($zp, $length, $allowable_tags); |
|
313 | + } else { |
|
314 | + $result = \gzgetss($zp, $length); |
|
315 | + } |
|
316 | + if ($result === false) { |
|
317 | + throw ZlibException::createFromPhpError(); |
|
318 | + } |
|
319 | + return $result; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | |
@@ -335,12 +335,12 @@ discard block |
||
335 | 335 | */ |
336 | 336 | function gzinflate(string $data, int $length = 0): string |
337 | 337 | { |
338 | - error_clear_last(); |
|
339 | - $result = \gzinflate($data, $length); |
|
340 | - if ($result === false) { |
|
341 | - throw ZlibException::createFromPhpError(); |
|
342 | - } |
|
343 | - return $result; |
|
338 | + error_clear_last(); |
|
339 | + $result = \gzinflate($data, $length); |
|
340 | + if ($result === false) { |
|
341 | + throw ZlibException::createFromPhpError(); |
|
342 | + } |
|
343 | + return $result; |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | |
@@ -357,12 +357,12 @@ discard block |
||
357 | 357 | */ |
358 | 358 | function gzpassthru($zp): int |
359 | 359 | { |
360 | - error_clear_last(); |
|
361 | - $result = \gzpassthru($zp); |
|
362 | - if ($result === false) { |
|
363 | - throw ZlibException::createFromPhpError(); |
|
364 | - } |
|
365 | - return $result; |
|
360 | + error_clear_last(); |
|
361 | + $result = \gzpassthru($zp); |
|
362 | + if ($result === false) { |
|
363 | + throw ZlibException::createFromPhpError(); |
|
364 | + } |
|
365 | + return $result; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | |
@@ -377,11 +377,11 @@ discard block |
||
377 | 377 | */ |
378 | 378 | function gzrewind($zp): void |
379 | 379 | { |
380 | - error_clear_last(); |
|
381 | - $result = \gzrewind($zp); |
|
382 | - if ($result === false) { |
|
383 | - throw ZlibException::createFromPhpError(); |
|
384 | - } |
|
380 | + error_clear_last(); |
|
381 | + $result = \gzrewind($zp); |
|
382 | + if ($result === false) { |
|
383 | + throw ZlibException::createFromPhpError(); |
|
384 | + } |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | |
@@ -400,12 +400,12 @@ discard block |
||
400 | 400 | */ |
401 | 401 | function gzuncompress(string $data, int $length = 0): string |
402 | 402 | { |
403 | - error_clear_last(); |
|
404 | - $result = \gzuncompress($data, $length); |
|
405 | - if ($result === false) { |
|
406 | - throw ZlibException::createFromPhpError(); |
|
407 | - } |
|
408 | - return $result; |
|
403 | + error_clear_last(); |
|
404 | + $result = \gzuncompress($data, $length); |
|
405 | + if ($result === false) { |
|
406 | + throw ZlibException::createFromPhpError(); |
|
407 | + } |
|
408 | + return $result; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | |
@@ -419,12 +419,12 @@ discard block |
||
419 | 419 | */ |
420 | 420 | function inflate_get_read_len($resource): int |
421 | 421 | { |
422 | - error_clear_last(); |
|
423 | - $result = \inflate_get_read_len($resource); |
|
424 | - if ($result === false) { |
|
425 | - throw ZlibException::createFromPhpError(); |
|
426 | - } |
|
427 | - return $result; |
|
422 | + error_clear_last(); |
|
423 | + $result = \inflate_get_read_len($resource); |
|
424 | + if ($result === false) { |
|
425 | + throw ZlibException::createFromPhpError(); |
|
426 | + } |
|
427 | + return $result; |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | |
@@ -438,12 +438,12 @@ discard block |
||
438 | 438 | */ |
439 | 439 | function inflate_get_status($resource): int |
440 | 440 | { |
441 | - error_clear_last(); |
|
442 | - $result = \inflate_get_status($resource); |
|
443 | - if ($result === false) { |
|
444 | - throw ZlibException::createFromPhpError(); |
|
445 | - } |
|
446 | - return $result; |
|
441 | + error_clear_last(); |
|
442 | + $result = \inflate_get_status($resource); |
|
443 | + if ($result === false) { |
|
444 | + throw ZlibException::createFromPhpError(); |
|
445 | + } |
|
446 | + return $result; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | |
@@ -470,12 +470,12 @@ discard block |
||
470 | 470 | */ |
471 | 471 | function inflate_add($context, string $encoded_data, int $flush_mode = ZLIB_SYNC_FLUSH): string |
472 | 472 | { |
473 | - error_clear_last(); |
|
474 | - $result = \inflate_add($context, $encoded_data, $flush_mode); |
|
475 | - if ($result === false) { |
|
476 | - throw ZlibException::createFromPhpError(); |
|
477 | - } |
|
478 | - return $result; |
|
473 | + error_clear_last(); |
|
474 | + $result = \inflate_add($context, $encoded_data, $flush_mode); |
|
475 | + if ($result === false) { |
|
476 | + throw ZlibException::createFromPhpError(); |
|
477 | + } |
|
478 | + return $result; |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | |
@@ -552,12 +552,12 @@ discard block |
||
552 | 552 | */ |
553 | 553 | function inflate_init(int $encoding, array $options = null) |
554 | 554 | { |
555 | - error_clear_last(); |
|
556 | - $result = \inflate_init($encoding, $options); |
|
557 | - if ($result === false) { |
|
558 | - throw ZlibException::createFromPhpError(); |
|
559 | - } |
|
560 | - return $result; |
|
555 | + error_clear_last(); |
|
556 | + $result = \inflate_init($encoding, $options); |
|
557 | + if ($result === false) { |
|
558 | + throw ZlibException::createFromPhpError(); |
|
559 | + } |
|
560 | + return $result; |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | |
@@ -578,12 +578,12 @@ discard block |
||
578 | 578 | */ |
579 | 579 | function readgzfile(string $filename, int $use_include_path = 0): int |
580 | 580 | { |
581 | - error_clear_last(); |
|
582 | - $result = \readgzfile($filename, $use_include_path); |
|
583 | - if ($result === false) { |
|
584 | - throw ZlibException::createFromPhpError(); |
|
585 | - } |
|
586 | - return $result; |
|
581 | + error_clear_last(); |
|
582 | + $result = \readgzfile($filename, $use_include_path); |
|
583 | + if ($result === false) { |
|
584 | + throw ZlibException::createFromPhpError(); |
|
585 | + } |
|
586 | + return $result; |
|
587 | 587 | } |
588 | 588 | |
589 | 589 | |
@@ -598,14 +598,14 @@ discard block |
||
598 | 598 | */ |
599 | 599 | function zlib_decode(string $data, int $max_decoded_len = null): string |
600 | 600 | { |
601 | - error_clear_last(); |
|
602 | - if ($max_decoded_len !== null) { |
|
603 | - $result = \zlib_decode($data, $max_decoded_len); |
|
604 | - } else { |
|
605 | - $result = \zlib_decode($data); |
|
606 | - } |
|
607 | - if ($result === false) { |
|
608 | - throw ZlibException::createFromPhpError(); |
|
609 | - } |
|
610 | - return $result; |
|
601 | + error_clear_last(); |
|
602 | + if ($max_decoded_len !== null) { |
|
603 | + $result = \zlib_decode($data, $max_decoded_len); |
|
604 | + } else { |
|
605 | + $result = \zlib_decode($data); |
|
606 | + } |
|
607 | + if ($result === false) { |
|
608 | + throw ZlibException::createFromPhpError(); |
|
609 | + } |
|
610 | + return $result; |
|
611 | 611 | } |
@@ -113,14 +113,14 @@ |
||
113 | 113 | */ |
114 | 114 | function password_hash(string $password, $algo, array $options = null): string |
115 | 115 | { |
116 | - error_clear_last(); |
|
117 | - if ($options !== null) { |
|
118 | - $result = \password_hash($password, $algo, $options); |
|
119 | - } else { |
|
120 | - $result = \password_hash($password, $algo); |
|
121 | - } |
|
122 | - if ($result === false) { |
|
123 | - throw PasswordException::createFromPhpError(); |
|
124 | - } |
|
125 | - return $result; |
|
116 | + error_clear_last(); |
|
117 | + if ($options !== null) { |
|
118 | + $result = \password_hash($password, $algo, $options); |
|
119 | + } else { |
|
120 | + $result = \password_hash($password, $algo); |
|
121 | + } |
|
122 | + if ($result === false) { |
|
123 | + throw PasswordException::createFromPhpError(); |
|
124 | + } |
|
125 | + return $result; |
|
126 | 126 | } |