@@ -22,17 +22,17 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | function pcntl_exec(string $path, array $args = null, array $envs = null): void |
| 24 | 24 | { |
| 25 | - error_clear_last(); |
|
| 26 | - if ($envs !== null) { |
|
| 27 | - $result = \pcntl_exec($path, $args, $envs); |
|
| 28 | - } elseif ($args !== null) { |
|
| 29 | - $result = \pcntl_exec($path, $args); |
|
| 30 | - } else { |
|
| 31 | - $result = \pcntl_exec($path); |
|
| 32 | - } |
|
| 33 | - if ($result === false) { |
|
| 34 | - throw PcntlException::createFromPhpError(); |
|
| 35 | - } |
|
| 25 | + error_clear_last(); |
|
| 26 | + if ($envs !== null) { |
|
| 27 | + $result = \pcntl_exec($path, $args, $envs); |
|
| 28 | + } elseif ($args !== null) { |
|
| 29 | + $result = \pcntl_exec($path, $args); |
|
| 30 | + } else { |
|
| 31 | + $result = \pcntl_exec($path); |
|
| 32 | + } |
|
| 33 | + if ($result === false) { |
|
| 34 | + throw PcntlException::createFromPhpError(); |
|
| 35 | + } |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
@@ -52,18 +52,18 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | function pcntl_getpriority(int $pid = null, int $process_identifier = PRIO_PROCESS): int |
| 54 | 54 | { |
| 55 | - error_clear_last(); |
|
| 56 | - if ($process_identifier !== PRIO_PROCESS) { |
|
| 57 | - $result = \pcntl_getpriority($pid, $process_identifier); |
|
| 58 | - } elseif ($pid !== null) { |
|
| 59 | - $result = \pcntl_getpriority($pid); |
|
| 60 | - } else { |
|
| 61 | - $result = \pcntl_getpriority(); |
|
| 62 | - } |
|
| 63 | - if ($result === false) { |
|
| 64 | - throw PcntlException::createFromPhpError(); |
|
| 65 | - } |
|
| 66 | - return $result; |
|
| 55 | + error_clear_last(); |
|
| 56 | + if ($process_identifier !== PRIO_PROCESS) { |
|
| 57 | + $result = \pcntl_getpriority($pid, $process_identifier); |
|
| 58 | + } elseif ($pid !== null) { |
|
| 59 | + $result = \pcntl_getpriority($pid); |
|
| 60 | + } else { |
|
| 61 | + $result = \pcntl_getpriority(); |
|
| 62 | + } |
|
| 63 | + if ($result === false) { |
|
| 64 | + throw PcntlException::createFromPhpError(); |
|
| 65 | + } |
|
| 66 | + return $result; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
@@ -85,17 +85,17 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | function pcntl_setpriority(int $priority, int $pid = null, int $process_identifier = PRIO_PROCESS): void |
| 87 | 87 | { |
| 88 | - error_clear_last(); |
|
| 89 | - if ($process_identifier !== PRIO_PROCESS) { |
|
| 90 | - $result = \pcntl_setpriority($priority, $pid, $process_identifier); |
|
| 91 | - } elseif ($pid !== null) { |
|
| 92 | - $result = \pcntl_setpriority($priority, $pid); |
|
| 93 | - } else { |
|
| 94 | - $result = \pcntl_setpriority($priority); |
|
| 95 | - } |
|
| 96 | - if ($result === false) { |
|
| 97 | - throw PcntlException::createFromPhpError(); |
|
| 98 | - } |
|
| 88 | + error_clear_last(); |
|
| 89 | + if ($process_identifier !== PRIO_PROCESS) { |
|
| 90 | + $result = \pcntl_setpriority($priority, $pid, $process_identifier); |
|
| 91 | + } elseif ($pid !== null) { |
|
| 92 | + $result = \pcntl_setpriority($priority, $pid); |
|
| 93 | + } else { |
|
| 94 | + $result = \pcntl_setpriority($priority); |
|
| 95 | + } |
|
| 96 | + if ($result === false) { |
|
| 97 | + throw PcntlException::createFromPhpError(); |
|
| 98 | + } |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | function pcntl_signal_dispatch(): void |
| 111 | 111 | { |
| 112 | - error_clear_last(); |
|
| 113 | - $result = \pcntl_signal_dispatch(); |
|
| 114 | - if ($result === false) { |
|
| 115 | - throw PcntlException::createFromPhpError(); |
|
| 116 | - } |
|
| 112 | + error_clear_last(); |
|
| 113 | + $result = \pcntl_signal_dispatch(); |
|
| 114 | + if ($result === false) { |
|
| 115 | + throw PcntlException::createFromPhpError(); |
|
| 116 | + } |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | function pcntl_sigprocmask(int $how, array $set, ?array &$oldset = null): void |
| 141 | 141 | { |
| 142 | - error_clear_last(); |
|
| 143 | - $result = \pcntl_sigprocmask($how, $set, $oldset); |
|
| 144 | - if ($result === false) { |
|
| 145 | - throw PcntlException::createFromPhpError(); |
|
| 146 | - } |
|
| 142 | + error_clear_last(); |
|
| 143 | + $result = \pcntl_sigprocmask($how, $set, $oldset); |
|
| 144 | + if ($result === false) { |
|
| 145 | + throw PcntlException::createFromPhpError(); |
|
| 146 | + } |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
@@ -157,10 +157,10 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | function pcntl_strerror(int $errno): string |
| 159 | 159 | { |
| 160 | - error_clear_last(); |
|
| 161 | - $result = \pcntl_strerror($errno); |
|
| 162 | - if ($result === false) { |
|
| 163 | - throw PcntlException::createFromPhpError(); |
|
| 164 | - } |
|
| 165 | - return $result; |
|
| 160 | + error_clear_last(); |
|
| 161 | + $result = \pcntl_strerror($errno); |
|
| 162 | + if ($result === false) { |
|
| 163 | + throw PcntlException::createFromPhpError(); |
|
| 164 | + } |
|
| 165 | + return $result; |
|
| 166 | 166 | } |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function create_function(string $args, string $code): string |
| 18 | 18 | { |
| 19 | - error_clear_last(); |
|
| 20 | - $result = \create_function($args, $code); |
|
| 21 | - if ($result === false) { |
|
| 22 | - throw FunchandException::createFromPhpError(); |
|
| 23 | - } |
|
| 24 | - return $result; |
|
| 19 | + error_clear_last(); |
|
| 20 | + $result = \create_function($args, $code); |
|
| 21 | + if ($result === false) { |
|
| 22 | + throw FunchandException::createFromPhpError(); |
|
| 23 | + } |
|
| 24 | + return $result; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function register_tick_function(callable $function, ...$params): void |
| 37 | 37 | { |
| 38 | - error_clear_last(); |
|
| 39 | - if ($params !== []) { |
|
| 40 | - $result = \register_tick_function($function, ...$params); |
|
| 41 | - } else { |
|
| 42 | - $result = \register_tick_function($function); |
|
| 43 | - } |
|
| 44 | - if ($result === false) { |
|
| 45 | - throw FunchandException::createFromPhpError(); |
|
| 46 | - } |
|
| 38 | + error_clear_last(); |
|
| 39 | + if ($params !== []) { |
|
| 40 | + $result = \register_tick_function($function, ...$params); |
|
| 41 | + } else { |
|
| 42 | + $result = \register_tick_function($function); |
|
| 43 | + } |
|
| 44 | + if ($result === false) { |
|
| 45 | + throw FunchandException::createFromPhpError(); |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | function imap_append($imap_stream, string $mailbox, string $message, string $options = null, string $internal_date = null): void |
| 26 | 26 | { |
| 27 | - error_clear_last(); |
|
| 28 | - $result = \imap_append($imap_stream, $mailbox, $message, $options, $internal_date); |
|
| 29 | - if ($result === false) { |
|
| 30 | - throw ImapException::createFromPhpError(); |
|
| 31 | - } |
|
| 27 | + error_clear_last(); |
|
| 28 | + $result = \imap_append($imap_stream, $mailbox, $message, $options, $internal_date); |
|
| 29 | + if ($result === false) { |
|
| 30 | + throw ImapException::createFromPhpError(); |
|
| 31 | + } |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
@@ -73,12 +73,12 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | function imap_check($imap_stream): \stdClass |
| 75 | 75 | { |
| 76 | - error_clear_last(); |
|
| 77 | - $result = \imap_check($imap_stream); |
|
| 78 | - if ($result === false) { |
|
| 79 | - throw ImapException::createFromPhpError(); |
|
| 80 | - } |
|
| 81 | - return $result; |
|
| 76 | + error_clear_last(); |
|
| 77 | + $result = \imap_check($imap_stream); |
|
| 78 | + if ($result === false) { |
|
| 79 | + throw ImapException::createFromPhpError(); |
|
| 80 | + } |
|
| 81 | + return $result; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | function imap_clearflag_full($imap_stream, string $sequence, string $flag, int $options = 0): void |
| 111 | 111 | { |
| 112 | - error_clear_last(); |
|
| 113 | - $result = \imap_clearflag_full($imap_stream, $sequence, $flag, $options); |
|
| 114 | - if ($result === false) { |
|
| 115 | - throw ImapException::createFromPhpError(); |
|
| 116 | - } |
|
| 112 | + error_clear_last(); |
|
| 113 | + $result = \imap_clearflag_full($imap_stream, $sequence, $flag, $options); |
|
| 114 | + if ($result === false) { |
|
| 115 | + throw ImapException::createFromPhpError(); |
|
| 116 | + } |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -131,11 +131,11 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function imap_close($imap_stream, int $flag = 0): void |
| 133 | 133 | { |
| 134 | - error_clear_last(); |
|
| 135 | - $result = \imap_close($imap_stream, $flag); |
|
| 136 | - if ($result === false) { |
|
| 137 | - throw ImapException::createFromPhpError(); |
|
| 138 | - } |
|
| 134 | + error_clear_last(); |
|
| 135 | + $result = \imap_close($imap_stream, $flag); |
|
| 136 | + if ($result === false) { |
|
| 137 | + throw ImapException::createFromPhpError(); |
|
| 138 | + } |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
@@ -152,11 +152,11 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | function imap_createmailbox($imap_stream, string $mailbox): void |
| 154 | 154 | { |
| 155 | - error_clear_last(); |
|
| 156 | - $result = \imap_createmailbox($imap_stream, $mailbox); |
|
| 157 | - if ($result === false) { |
|
| 158 | - throw ImapException::createFromPhpError(); |
|
| 159 | - } |
|
| 155 | + error_clear_last(); |
|
| 156 | + $result = \imap_createmailbox($imap_stream, $mailbox); |
|
| 157 | + if ($result === false) { |
|
| 158 | + throw ImapException::createFromPhpError(); |
|
| 159 | + } |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
@@ -172,11 +172,11 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | function imap_deletemailbox($imap_stream, string $mailbox): void |
| 174 | 174 | { |
| 175 | - error_clear_last(); |
|
| 176 | - $result = \imap_deletemailbox($imap_stream, $mailbox); |
|
| 177 | - if ($result === false) { |
|
| 178 | - throw ImapException::createFromPhpError(); |
|
| 179 | - } |
|
| 175 | + error_clear_last(); |
|
| 176 | + $result = \imap_deletemailbox($imap_stream, $mailbox); |
|
| 177 | + if ($result === false) { |
|
| 178 | + throw ImapException::createFromPhpError(); |
|
| 179 | + } |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -319,12 +319,12 @@ discard block |
||
| 319 | 319 | */ |
| 320 | 320 | function imap_fetchstructure($imap_stream, int $msg_number, int $options = 0): \stdClass |
| 321 | 321 | { |
| 322 | - error_clear_last(); |
|
| 323 | - $result = \imap_fetchstructure($imap_stream, $msg_number, $options); |
|
| 324 | - if ($result === false) { |
|
| 325 | - throw ImapException::createFromPhpError(); |
|
| 326 | - } |
|
| 327 | - return $result; |
|
| 322 | + error_clear_last(); |
|
| 323 | + $result = \imap_fetchstructure($imap_stream, $msg_number, $options); |
|
| 324 | + if ($result === false) { |
|
| 325 | + throw ImapException::createFromPhpError(); |
|
| 326 | + } |
|
| 327 | + return $result; |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
@@ -343,11 +343,11 @@ discard block |
||
| 343 | 343 | */ |
| 344 | 344 | function imap_gc($imap_stream, int $caches): void |
| 345 | 345 | { |
| 346 | - error_clear_last(); |
|
| 347 | - $result = \imap_gc($imap_stream, $caches); |
|
| 348 | - if ($result === false) { |
|
| 349 | - throw ImapException::createFromPhpError(); |
|
| 350 | - } |
|
| 346 | + error_clear_last(); |
|
| 347 | + $result = \imap_gc($imap_stream, $caches); |
|
| 348 | + if ($result === false) { |
|
| 349 | + throw ImapException::createFromPhpError(); |
|
| 350 | + } |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | |
@@ -569,12 +569,12 @@ discard block |
||
| 569 | 569 | */ |
| 570 | 570 | function imap_headerinfo($imap_stream, int $msg_number, int $fromlength = 0, int $subjectlength = 0, string $defaulthost = null): \stdClass |
| 571 | 571 | { |
| 572 | - error_clear_last(); |
|
| 573 | - $result = \imap_headerinfo($imap_stream, $msg_number, $fromlength, $subjectlength, $defaulthost); |
|
| 574 | - if ($result === false) { |
|
| 575 | - throw ImapException::createFromPhpError(); |
|
| 576 | - } |
|
| 577 | - return $result; |
|
| 572 | + error_clear_last(); |
|
| 573 | + $result = \imap_headerinfo($imap_stream, $msg_number, $fromlength, $subjectlength, $defaulthost); |
|
| 574 | + if ($result === false) { |
|
| 575 | + throw ImapException::createFromPhpError(); |
|
| 576 | + } |
|
| 577 | + return $result; |
|
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | |
@@ -687,12 +687,12 @@ discard block |
||
| 687 | 687 | */ |
| 688 | 688 | function imap_mail_compose(array $envelope, array $body): string |
| 689 | 689 | { |
| 690 | - error_clear_last(); |
|
| 691 | - $result = \imap_mail_compose($envelope, $body); |
|
| 692 | - if ($result === false) { |
|
| 693 | - throw ImapException::createFromPhpError(); |
|
| 694 | - } |
|
| 695 | - return $result; |
|
| 690 | + error_clear_last(); |
|
| 691 | + $result = \imap_mail_compose($envelope, $body); |
|
| 692 | + if ($result === false) { |
|
| 693 | + throw ImapException::createFromPhpError(); |
|
| 694 | + } |
|
| 695 | + return $result; |
|
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | |
@@ -725,11 +725,11 @@ discard block |
||
| 725 | 725 | */ |
| 726 | 726 | function imap_mail_copy($imap_stream, string $msglist, string $mailbox, int $options = 0): void |
| 727 | 727 | { |
| 728 | - error_clear_last(); |
|
| 729 | - $result = \imap_mail_copy($imap_stream, $msglist, $mailbox, $options); |
|
| 730 | - if ($result === false) { |
|
| 731 | - throw ImapException::createFromPhpError(); |
|
| 732 | - } |
|
| 728 | + error_clear_last(); |
|
| 729 | + $result = \imap_mail_copy($imap_stream, $msglist, $mailbox, $options); |
|
| 730 | + if ($result === false) { |
|
| 731 | + throw ImapException::createFromPhpError(); |
|
| 732 | + } |
|
| 733 | 733 | } |
| 734 | 734 | |
| 735 | 735 | |
@@ -756,11 +756,11 @@ discard block |
||
| 756 | 756 | */ |
| 757 | 757 | function imap_mail_move($imap_stream, string $msglist, string $mailbox, int $options = 0): void |
| 758 | 758 | { |
| 759 | - error_clear_last(); |
|
| 760 | - $result = \imap_mail_move($imap_stream, $msglist, $mailbox, $options); |
|
| 761 | - if ($result === false) { |
|
| 762 | - throw ImapException::createFromPhpError(); |
|
| 763 | - } |
|
| 759 | + error_clear_last(); |
|
| 760 | + $result = \imap_mail_move($imap_stream, $msglist, $mailbox, $options); |
|
| 761 | + if ($result === false) { |
|
| 762 | + throw ImapException::createFromPhpError(); |
|
| 763 | + } |
|
| 764 | 764 | } |
| 765 | 765 | |
| 766 | 766 | |
@@ -786,11 +786,11 @@ discard block |
||
| 786 | 786 | */ |
| 787 | 787 | function imap_mail(string $to, string $subject, string $message, string $additional_headers = null, string $cc = null, string $bcc = null, string $rpath = null): void |
| 788 | 788 | { |
| 789 | - error_clear_last(); |
|
| 790 | - $result = \imap_mail($to, $subject, $message, $additional_headers, $cc, $bcc, $rpath); |
|
| 791 | - if ($result === false) { |
|
| 792 | - throw ImapException::createFromPhpError(); |
|
| 793 | - } |
|
| 789 | + error_clear_last(); |
|
| 790 | + $result = \imap_mail($to, $subject, $message, $additional_headers, $cc, $bcc, $rpath); |
|
| 791 | + if ($result === false) { |
|
| 792 | + throw ImapException::createFromPhpError(); |
|
| 793 | + } |
|
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | |
@@ -849,12 +849,12 @@ discard block |
||
| 849 | 849 | */ |
| 850 | 850 | function imap_mailboxmsginfo($imap_stream): \stdClass |
| 851 | 851 | { |
| 852 | - error_clear_last(); |
|
| 853 | - $result = \imap_mailboxmsginfo($imap_stream); |
|
| 854 | - if ($result === false) { |
|
| 855 | - throw ImapException::createFromPhpError(); |
|
| 856 | - } |
|
| 857 | - return $result; |
|
| 852 | + error_clear_last(); |
|
| 853 | + $result = \imap_mailboxmsginfo($imap_stream); |
|
| 854 | + if ($result === false) { |
|
| 855 | + throw ImapException::createFromPhpError(); |
|
| 856 | + } |
|
| 857 | + return $result; |
|
| 858 | 858 | } |
| 859 | 859 | |
| 860 | 860 | |
@@ -868,12 +868,12 @@ discard block |
||
| 868 | 868 | */ |
| 869 | 869 | function imap_mutf7_to_utf8(string $in): string |
| 870 | 870 | { |
| 871 | - error_clear_last(); |
|
| 872 | - $result = \imap_mutf7_to_utf8($in); |
|
| 873 | - if ($result === false) { |
|
| 874 | - throw ImapException::createFromPhpError(); |
|
| 875 | - } |
|
| 876 | - return $result; |
|
| 871 | + error_clear_last(); |
|
| 872 | + $result = \imap_mutf7_to_utf8($in); |
|
| 873 | + if ($result === false) { |
|
| 874 | + throw ImapException::createFromPhpError(); |
|
| 875 | + } |
|
| 876 | + return $result; |
|
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | |
@@ -888,12 +888,12 @@ discard block |
||
| 888 | 888 | */ |
| 889 | 889 | function imap_num_msg($imap_stream): int |
| 890 | 890 | { |
| 891 | - error_clear_last(); |
|
| 892 | - $result = \imap_num_msg($imap_stream); |
|
| 893 | - if ($result === false) { |
|
| 894 | - throw ImapException::createFromPhpError(); |
|
| 895 | - } |
|
| 896 | - return $result; |
|
| 891 | + error_clear_last(); |
|
| 892 | + $result = \imap_num_msg($imap_stream); |
|
| 893 | + if ($result === false) { |
|
| 894 | + throw ImapException::createFromPhpError(); |
|
| 895 | + } |
|
| 896 | + return $result; |
|
| 897 | 897 | } |
| 898 | 898 | |
| 899 | 899 | |
@@ -1103,12 +1103,12 @@ discard block |
||
| 1103 | 1103 | */ |
| 1104 | 1104 | function imap_open(string $mailbox, string $username, string $password, int $options = 0, int $n_retries = 0, ?array $params = null) |
| 1105 | 1105 | { |
| 1106 | - error_clear_last(); |
|
| 1107 | - $result = \imap_open($mailbox, $username, $password, $options, $n_retries, $params); |
|
| 1108 | - if ($result === false) { |
|
| 1109 | - throw ImapException::createFromPhpError(); |
|
| 1110 | - } |
|
| 1111 | - return $result; |
|
| 1106 | + error_clear_last(); |
|
| 1107 | + $result = \imap_open($mailbox, $username, $password, $options, $n_retries, $params); |
|
| 1108 | + if ($result === false) { |
|
| 1109 | + throw ImapException::createFromPhpError(); |
|
| 1110 | + } |
|
| 1111 | + return $result; |
|
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | |
@@ -1128,11 +1128,11 @@ discard block |
||
| 1128 | 1128 | */ |
| 1129 | 1129 | function imap_renamemailbox($imap_stream, string $old_mbox, string $new_mbox): void |
| 1130 | 1130 | { |
| 1131 | - error_clear_last(); |
|
| 1132 | - $result = \imap_renamemailbox($imap_stream, $old_mbox, $new_mbox); |
|
| 1133 | - if ($result === false) { |
|
| 1134 | - throw ImapException::createFromPhpError(); |
|
| 1135 | - } |
|
| 1131 | + error_clear_last(); |
|
| 1132 | + $result = \imap_renamemailbox($imap_stream, $old_mbox, $new_mbox); |
|
| 1133 | + if ($result === false) { |
|
| 1134 | + throw ImapException::createFromPhpError(); |
|
| 1135 | + } |
|
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | |
@@ -1171,11 +1171,11 @@ discard block |
||
| 1171 | 1171 | */ |
| 1172 | 1172 | function imap_savebody($imap_stream, $file, int $msg_number, string $part_number = "", int $options = 0): void |
| 1173 | 1173 | { |
| 1174 | - error_clear_last(); |
|
| 1175 | - $result = \imap_savebody($imap_stream, $file, $msg_number, $part_number, $options); |
|
| 1176 | - if ($result === false) { |
|
| 1177 | - throw ImapException::createFromPhpError(); |
|
| 1178 | - } |
|
| 1174 | + error_clear_last(); |
|
| 1175 | + $result = \imap_savebody($imap_stream, $file, $msg_number, $part_number, $options); |
|
| 1176 | + if ($result === false) { |
|
| 1177 | + throw ImapException::createFromPhpError(); |
|
| 1178 | + } |
|
| 1179 | 1179 | } |
| 1180 | 1180 | |
| 1181 | 1181 | |
@@ -1192,11 +1192,11 @@ discard block |
||
| 1192 | 1192 | */ |
| 1193 | 1193 | function imap_set_quota($imap_stream, string $quota_root, int $quota_limit): void |
| 1194 | 1194 | { |
| 1195 | - error_clear_last(); |
|
| 1196 | - $result = \imap_set_quota($imap_stream, $quota_root, $quota_limit); |
|
| 1197 | - if ($result === false) { |
|
| 1198 | - throw ImapException::createFromPhpError(); |
|
| 1199 | - } |
|
| 1195 | + error_clear_last(); |
|
| 1196 | + $result = \imap_set_quota($imap_stream, $quota_root, $quota_limit); |
|
| 1197 | + if ($result === false) { |
|
| 1198 | + throw ImapException::createFromPhpError(); |
|
| 1199 | + } |
|
| 1200 | 1200 | } |
| 1201 | 1201 | |
| 1202 | 1202 | |
@@ -1215,11 +1215,11 @@ discard block |
||
| 1215 | 1215 | */ |
| 1216 | 1216 | function imap_setacl($imap_stream, string $mailbox, string $id, string $rights): void |
| 1217 | 1217 | { |
| 1218 | - error_clear_last(); |
|
| 1219 | - $result = \imap_setacl($imap_stream, $mailbox, $id, $rights); |
|
| 1220 | - if ($result === false) { |
|
| 1221 | - throw ImapException::createFromPhpError(); |
|
| 1222 | - } |
|
| 1218 | + error_clear_last(); |
|
| 1219 | + $result = \imap_setacl($imap_stream, $mailbox, $id, $rights); |
|
| 1220 | + if ($result === false) { |
|
| 1221 | + throw ImapException::createFromPhpError(); |
|
| 1222 | + } |
|
| 1223 | 1223 | } |
| 1224 | 1224 | |
| 1225 | 1225 | |
@@ -1251,11 +1251,11 @@ discard block |
||
| 1251 | 1251 | */ |
| 1252 | 1252 | function imap_setflag_full($imap_stream, string $sequence, string $flag, int $options = NIL): void |
| 1253 | 1253 | { |
| 1254 | - error_clear_last(); |
|
| 1255 | - $result = \imap_setflag_full($imap_stream, $sequence, $flag, $options); |
|
| 1256 | - if ($result === false) { |
|
| 1257 | - throw ImapException::createFromPhpError(); |
|
| 1258 | - } |
|
| 1254 | + error_clear_last(); |
|
| 1255 | + $result = \imap_setflag_full($imap_stream, $sequence, $flag, $options); |
|
| 1256 | + if ($result === false) { |
|
| 1257 | + throw ImapException::createFromPhpError(); |
|
| 1258 | + } |
|
| 1259 | 1259 | } |
| 1260 | 1260 | |
| 1261 | 1261 | |
@@ -1327,12 +1327,12 @@ discard block |
||
| 1327 | 1327 | */ |
| 1328 | 1328 | function imap_sort($imap_stream, int $criteria, int $reverse, int $options = 0, string $search_criteria = null, string $charset = null): array |
| 1329 | 1329 | { |
| 1330 | - error_clear_last(); |
|
| 1331 | - $result = \imap_sort($imap_stream, $criteria, $reverse, $options, $search_criteria, $charset); |
|
| 1332 | - if ($result === false) { |
|
| 1333 | - throw ImapException::createFromPhpError(); |
|
| 1334 | - } |
|
| 1335 | - return $result; |
|
| 1330 | + error_clear_last(); |
|
| 1331 | + $result = \imap_sort($imap_stream, $criteria, $reverse, $options, $search_criteria, $charset); |
|
| 1332 | + if ($result === false) { |
|
| 1333 | + throw ImapException::createFromPhpError(); |
|
| 1334 | + } |
|
| 1335 | + return $result; |
|
| 1336 | 1336 | } |
| 1337 | 1337 | |
| 1338 | 1338 | |
@@ -1348,11 +1348,11 @@ discard block |
||
| 1348 | 1348 | */ |
| 1349 | 1349 | function imap_subscribe($imap_stream, string $mailbox): void |
| 1350 | 1350 | { |
| 1351 | - error_clear_last(); |
|
| 1352 | - $result = \imap_subscribe($imap_stream, $mailbox); |
|
| 1353 | - if ($result === false) { |
|
| 1354 | - throw ImapException::createFromPhpError(); |
|
| 1355 | - } |
|
| 1351 | + error_clear_last(); |
|
| 1352 | + $result = \imap_subscribe($imap_stream, $mailbox); |
|
| 1353 | + if ($result === false) { |
|
| 1354 | + throw ImapException::createFromPhpError(); |
|
| 1355 | + } |
|
| 1356 | 1356 | } |
| 1357 | 1357 | |
| 1358 | 1358 | |
@@ -1383,12 +1383,12 @@ discard block |
||
| 1383 | 1383 | */ |
| 1384 | 1384 | function imap_thread($imap_stream, int $options = SE_FREE): array |
| 1385 | 1385 | { |
| 1386 | - error_clear_last(); |
|
| 1387 | - $result = \imap_thread($imap_stream, $options); |
|
| 1388 | - if ($result === false) { |
|
| 1389 | - throw ImapException::createFromPhpError(); |
|
| 1390 | - } |
|
| 1391 | - return $result; |
|
| 1386 | + error_clear_last(); |
|
| 1387 | + $result = \imap_thread($imap_stream, $options); |
|
| 1388 | + if ($result === false) { |
|
| 1389 | + throw ImapException::createFromPhpError(); |
|
| 1390 | + } |
|
| 1391 | + return $result; |
|
| 1392 | 1392 | } |
| 1393 | 1393 | |
| 1394 | 1394 | |
@@ -1412,12 +1412,12 @@ discard block |
||
| 1412 | 1412 | */ |
| 1413 | 1413 | function imap_timeout(int $timeout_type, int $timeout = -1) |
| 1414 | 1414 | { |
| 1415 | - error_clear_last(); |
|
| 1416 | - $result = \imap_timeout($timeout_type, $timeout); |
|
| 1417 | - if ($result === false) { |
|
| 1418 | - throw ImapException::createFromPhpError(); |
|
| 1419 | - } |
|
| 1420 | - return $result; |
|
| 1415 | + error_clear_last(); |
|
| 1416 | + $result = \imap_timeout($timeout_type, $timeout); |
|
| 1417 | + if ($result === false) { |
|
| 1418 | + throw ImapException::createFromPhpError(); |
|
| 1419 | + } |
|
| 1420 | + return $result; |
|
| 1421 | 1421 | } |
| 1422 | 1422 | |
| 1423 | 1423 | |
@@ -1434,11 +1434,11 @@ discard block |
||
| 1434 | 1434 | */ |
| 1435 | 1435 | function imap_undelete($imap_stream, int $msg_number, int $flags = 0): void |
| 1436 | 1436 | { |
| 1437 | - error_clear_last(); |
|
| 1438 | - $result = \imap_undelete($imap_stream, $msg_number, $flags); |
|
| 1439 | - if ($result === false) { |
|
| 1440 | - throw ImapException::createFromPhpError(); |
|
| 1441 | - } |
|
| 1437 | + error_clear_last(); |
|
| 1438 | + $result = \imap_undelete($imap_stream, $msg_number, $flags); |
|
| 1439 | + if ($result === false) { |
|
| 1440 | + throw ImapException::createFromPhpError(); |
|
| 1441 | + } |
|
| 1442 | 1442 | } |
| 1443 | 1443 | |
| 1444 | 1444 | |
@@ -1454,11 +1454,11 @@ discard block |
||
| 1454 | 1454 | */ |
| 1455 | 1455 | function imap_unsubscribe($imap_stream, string $mailbox): void |
| 1456 | 1456 | { |
| 1457 | - error_clear_last(); |
|
| 1458 | - $result = \imap_unsubscribe($imap_stream, $mailbox); |
|
| 1459 | - if ($result === false) { |
|
| 1460 | - throw ImapException::createFromPhpError(); |
|
| 1461 | - } |
|
| 1457 | + error_clear_last(); |
|
| 1458 | + $result = \imap_unsubscribe($imap_stream, $mailbox); |
|
| 1459 | + if ($result === false) { |
|
| 1460 | + throw ImapException::createFromPhpError(); |
|
| 1461 | + } |
|
| 1462 | 1462 | } |
| 1463 | 1463 | |
| 1464 | 1464 | |
@@ -1472,10 +1472,10 @@ discard block |
||
| 1472 | 1472 | */ |
| 1473 | 1473 | function imap_utf8_to_mutf7(string $in): string |
| 1474 | 1474 | { |
| 1475 | - error_clear_last(); |
|
| 1476 | - $result = \imap_utf8_to_mutf7($in); |
|
| 1477 | - if ($result === false) { |
|
| 1478 | - throw ImapException::createFromPhpError(); |
|
| 1479 | - } |
|
| 1480 | - return $result; |
|
| 1475 | + error_clear_last(); |
|
| 1476 | + $result = \imap_utf8_to_mutf7($in); |
|
| 1477 | + if ($result === false) { |
|
| 1478 | + throw ImapException::createFromPhpError(); |
|
| 1479 | + } |
|
| 1480 | + return $result; |
|
| 1481 | 1481 | } |
@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | function bzclose($bz): void |
| 16 | 16 | { |
| 17 | - error_clear_last(); |
|
| 18 | - $result = \bzclose($bz); |
|
| 19 | - if ($result === false) { |
|
| 20 | - throw Bzip2Exception::createFromPhpError(); |
|
| 21 | - } |
|
| 17 | + error_clear_last(); |
|
| 18 | + $result = \bzclose($bz); |
|
| 19 | + if ($result === false) { |
|
| 20 | + throw Bzip2Exception::createFromPhpError(); |
|
| 21 | + } |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | function bzflush($bz): void |
| 35 | 35 | { |
| 36 | - error_clear_last(); |
|
| 37 | - $result = \bzflush($bz); |
|
| 38 | - if ($result === false) { |
|
| 39 | - throw Bzip2Exception::createFromPhpError(); |
|
| 40 | - } |
|
| 36 | + error_clear_last(); |
|
| 37 | + $result = \bzflush($bz); |
|
| 38 | + if ($result === false) { |
|
| 39 | + throw Bzip2Exception::createFromPhpError(); |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | function bzread($bz, int $length = 1024): string |
| 60 | 60 | { |
| 61 | - error_clear_last(); |
|
| 62 | - $result = \bzread($bz, $length); |
|
| 63 | - if ($result === false) { |
|
| 64 | - throw Bzip2Exception::createFromPhpError(); |
|
| 65 | - } |
|
| 66 | - return $result; |
|
| 61 | + error_clear_last(); |
|
| 62 | + $result = \bzread($bz, $length); |
|
| 63 | + if ($result === false) { |
|
| 64 | + throw Bzip2Exception::createFromPhpError(); |
|
| 65 | + } |
|
| 66 | + return $result; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | function bzwrite($bz, string $data, int $length = null): int |
| 85 | 85 | { |
| 86 | - error_clear_last(); |
|
| 87 | - if ($length !== null) { |
|
| 88 | - $result = \bzwrite($bz, $data, $length); |
|
| 89 | - } else { |
|
| 90 | - $result = \bzwrite($bz, $data); |
|
| 91 | - } |
|
| 92 | - if ($result === false) { |
|
| 93 | - throw Bzip2Exception::createFromPhpError(); |
|
| 94 | - } |
|
| 95 | - return $result; |
|
| 86 | + error_clear_last(); |
|
| 87 | + if ($length !== null) { |
|
| 88 | + $result = \bzwrite($bz, $data, $length); |
|
| 89 | + } else { |
|
| 90 | + $result = \bzwrite($bz, $data); |
|
| 91 | + } |
|
| 92 | + if ($result === false) { |
|
| 93 | + throw Bzip2Exception::createFromPhpError(); |
|
| 94 | + } |
|
| 95 | + return $result; |
|
| 96 | 96 | } |
@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | function posix_access(string $file, int $mode = POSIX_F_OK): void |
| 24 | 24 | { |
| 25 | - error_clear_last(); |
|
| 26 | - $result = \posix_access($file, $mode); |
|
| 27 | - if ($result === false) { |
|
| 28 | - throw PosixException::createFromPhpError(); |
|
| 29 | - } |
|
| 25 | + error_clear_last(); |
|
| 26 | + $result = \posix_access($file, $mode); |
|
| 27 | + if ($result === false) { |
|
| 28 | + throw PosixException::createFromPhpError(); |
|
| 29 | + } |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | function posix_getgrnam(string $name): array |
| 87 | 87 | { |
| 88 | - error_clear_last(); |
|
| 89 | - $result = \posix_getgrnam($name); |
|
| 90 | - if ($result === false) { |
|
| 91 | - throw PosixException::createFromPhpError(); |
|
| 92 | - } |
|
| 93 | - return $result; |
|
| 88 | + error_clear_last(); |
|
| 89 | + $result = \posix_getgrnam($name); |
|
| 90 | + if ($result === false) { |
|
| 91 | + throw PosixException::createFromPhpError(); |
|
| 92 | + } |
|
| 93 | + return $result; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
@@ -105,12 +105,12 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | function posix_getpgid(int $pid): int |
| 107 | 107 | { |
| 108 | - error_clear_last(); |
|
| 109 | - $result = \posix_getpgid($pid); |
|
| 110 | - if ($result === false) { |
|
| 111 | - throw PosixException::createFromPhpError(); |
|
| 112 | - } |
|
| 113 | - return $result; |
|
| 108 | + error_clear_last(); |
|
| 109 | + $result = \posix_getpgid($pid); |
|
| 110 | + if ($result === false) { |
|
| 111 | + throw PosixException::createFromPhpError(); |
|
| 112 | + } |
|
| 113 | + return $result; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
@@ -124,11 +124,11 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | function posix_initgroups(string $name, int $base_group_id): void |
| 126 | 126 | { |
| 127 | - error_clear_last(); |
|
| 128 | - $result = \posix_initgroups($name, $base_group_id); |
|
| 129 | - if ($result === false) { |
|
| 130 | - throw PosixException::createFromPhpError(); |
|
| 131 | - } |
|
| 127 | + error_clear_last(); |
|
| 128 | + $result = \posix_initgroups($name, $base_group_id); |
|
| 129 | + if ($result === false) { |
|
| 130 | + throw PosixException::createFromPhpError(); |
|
| 131 | + } |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | function posix_kill(int $pid, int $sig): void |
| 145 | 145 | { |
| 146 | - error_clear_last(); |
|
| 147 | - $result = \posix_kill($pid, $sig); |
|
| 148 | - if ($result === false) { |
|
| 149 | - throw PosixException::createFromPhpError(); |
|
| 150 | - } |
|
| 146 | + error_clear_last(); |
|
| 147 | + $result = \posix_kill($pid, $sig); |
|
| 148 | + if ($result === false) { |
|
| 149 | + throw PosixException::createFromPhpError(); |
|
| 150 | + } |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
@@ -167,11 +167,11 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | function posix_mkfifo(string $pathname, int $mode): void |
| 169 | 169 | { |
| 170 | - error_clear_last(); |
|
| 171 | - $result = \posix_mkfifo($pathname, $mode); |
|
| 172 | - if ($result === false) { |
|
| 173 | - throw PosixException::createFromPhpError(); |
|
| 174 | - } |
|
| 170 | + error_clear_last(); |
|
| 171 | + $result = \posix_mkfifo($pathname, $mode); |
|
| 172 | + if ($result === false) { |
|
| 173 | + throw PosixException::createFromPhpError(); |
|
| 174 | + } |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
@@ -192,11 +192,11 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | function posix_mknod(string $pathname, int $mode, int $major = 0, int $minor = 0): void |
| 194 | 194 | { |
| 195 | - error_clear_last(); |
|
| 196 | - $result = \posix_mknod($pathname, $mode, $major, $minor); |
|
| 197 | - if ($result === false) { |
|
| 198 | - throw PosixException::createFromPhpError(); |
|
| 199 | - } |
|
| 195 | + error_clear_last(); |
|
| 196 | + $result = \posix_mknod($pathname, $mode, $major, $minor); |
|
| 197 | + if ($result === false) { |
|
| 198 | + throw PosixException::createFromPhpError(); |
|
| 199 | + } |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
@@ -211,11 +211,11 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | function posix_setegid(int $gid): void |
| 213 | 213 | { |
| 214 | - error_clear_last(); |
|
| 215 | - $result = \posix_setegid($gid); |
|
| 216 | - if ($result === false) { |
|
| 217 | - throw PosixException::createFromPhpError(); |
|
| 218 | - } |
|
| 214 | + error_clear_last(); |
|
| 215 | + $result = \posix_setegid($gid); |
|
| 216 | + if ($result === false) { |
|
| 217 | + throw PosixException::createFromPhpError(); |
|
| 218 | + } |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
@@ -230,11 +230,11 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | function posix_seteuid(int $uid): void |
| 232 | 232 | { |
| 233 | - error_clear_last(); |
|
| 234 | - $result = \posix_seteuid($uid); |
|
| 235 | - if ($result === false) { |
|
| 236 | - throw PosixException::createFromPhpError(); |
|
| 237 | - } |
|
| 233 | + error_clear_last(); |
|
| 234 | + $result = \posix_seteuid($uid); |
|
| 235 | + if ($result === false) { |
|
| 236 | + throw PosixException::createFromPhpError(); |
|
| 237 | + } |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | |
@@ -252,11 +252,11 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | function posix_setgid(int $gid): void |
| 254 | 254 | { |
| 255 | - error_clear_last(); |
|
| 256 | - $result = \posix_setgid($gid); |
|
| 257 | - if ($result === false) { |
|
| 258 | - throw PosixException::createFromPhpError(); |
|
| 259 | - } |
|
| 255 | + error_clear_last(); |
|
| 256 | + $result = \posix_setgid($gid); |
|
| 257 | + if ($result === false) { |
|
| 258 | + throw PosixException::createFromPhpError(); |
|
| 259 | + } |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | |
@@ -271,11 +271,11 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | function posix_setpgid(int $pid, int $pgid): void |
| 273 | 273 | { |
| 274 | - error_clear_last(); |
|
| 275 | - $result = \posix_setpgid($pid, $pgid); |
|
| 276 | - if ($result === false) { |
|
| 277 | - throw PosixException::createFromPhpError(); |
|
| 278 | - } |
|
| 274 | + error_clear_last(); |
|
| 275 | + $result = \posix_setpgid($pid, $pgid); |
|
| 276 | + if ($result === false) { |
|
| 277 | + throw PosixException::createFromPhpError(); |
|
| 278 | + } |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | |
@@ -302,11 +302,11 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | function posix_setrlimit(int $resource, int $softlimit, int $hardlimit): void |
| 304 | 304 | { |
| 305 | - error_clear_last(); |
|
| 306 | - $result = \posix_setrlimit($resource, $softlimit, $hardlimit); |
|
| 307 | - if ($result === false) { |
|
| 308 | - throw PosixException::createFromPhpError(); |
|
| 309 | - } |
|
| 305 | + error_clear_last(); |
|
| 306 | + $result = \posix_setrlimit($resource, $softlimit, $hardlimit); |
|
| 307 | + if ($result === false) { |
|
| 308 | + throw PosixException::createFromPhpError(); |
|
| 309 | + } |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | |
@@ -321,9 +321,9 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | function posix_setuid(int $uid): void |
| 323 | 323 | { |
| 324 | - error_clear_last(); |
|
| 325 | - $result = \posix_setuid($uid); |
|
| 326 | - if ($result === false) { |
|
| 327 | - throw PosixException::createFromPhpError(); |
|
| 328 | - } |
|
| 324 | + error_clear_last(); |
|
| 325 | + $result = \posix_setuid($uid); |
|
| 326 | + if ($result === false) { |
|
| 327 | + throw PosixException::createFromPhpError(); |
|
| 328 | + } |
|
| 329 | 329 | } |
@@ -14,12 +14,12 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | function convert_uudecode(string $data): string |
| 16 | 16 | { |
| 17 | - error_clear_last(); |
|
| 18 | - $result = \convert_uudecode($data); |
|
| 19 | - if ($result === false) { |
|
| 20 | - throw StringsException::createFromPhpError(); |
|
| 21 | - } |
|
| 22 | - return $result; |
|
| 17 | + error_clear_last(); |
|
| 18 | + $result = \convert_uudecode($data); |
|
| 19 | + if ($result === false) { |
|
| 20 | + throw StringsException::createFromPhpError(); |
|
| 21 | + } |
|
| 22 | + return $result; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | function convert_uuencode(string $data): string |
| 40 | 40 | { |
| 41 | - error_clear_last(); |
|
| 42 | - $result = \convert_uuencode($data); |
|
| 43 | - if ($result === false) { |
|
| 44 | - throw StringsException::createFromPhpError(); |
|
| 45 | - } |
|
| 46 | - return $result; |
|
| 41 | + error_clear_last(); |
|
| 42 | + $result = \convert_uuencode($data); |
|
| 43 | + if ($result === false) { |
|
| 44 | + throw StringsException::createFromPhpError(); |
|
| 45 | + } |
|
| 46 | + return $result; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | function hex2bin(string $data): string |
| 59 | 59 | { |
| 60 | - error_clear_last(); |
|
| 61 | - $result = \hex2bin($data); |
|
| 62 | - if ($result === false) { |
|
| 63 | - throw StringsException::createFromPhpError(); |
|
| 64 | - } |
|
| 65 | - return $result; |
|
| 60 | + error_clear_last(); |
|
| 61 | + $result = \hex2bin($data); |
|
| 62 | + if ($result === false) { |
|
| 63 | + throw StringsException::createFromPhpError(); |
|
| 64 | + } |
|
| 65 | + return $result; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | function md5_file(string $filename, bool $raw_output = false): string |
| 84 | 84 | { |
| 85 | - error_clear_last(); |
|
| 86 | - $result = \md5_file($filename, $raw_output); |
|
| 87 | - if ($result === false) { |
|
| 88 | - throw StringsException::createFromPhpError(); |
|
| 89 | - } |
|
| 90 | - return $result; |
|
| 85 | + error_clear_last(); |
|
| 86 | + $result = \md5_file($filename, $raw_output); |
|
| 87 | + if ($result === false) { |
|
| 88 | + throw StringsException::createFromPhpError(); |
|
| 89 | + } |
|
| 90 | + return $result; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
@@ -114,12 +114,12 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | function metaphone(string $str, int $phonemes = 0): string |
| 116 | 116 | { |
| 117 | - error_clear_last(); |
|
| 118 | - $result = \metaphone($str, $phonemes); |
|
| 119 | - if ($result === false) { |
|
| 120 | - throw StringsException::createFromPhpError(); |
|
| 121 | - } |
|
| 122 | - return $result; |
|
| 117 | + error_clear_last(); |
|
| 118 | + $result = \metaphone($str, $phonemes); |
|
| 119 | + if ($result === false) { |
|
| 120 | + throw StringsException::createFromPhpError(); |
|
| 121 | + } |
|
| 122 | + return $result; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
@@ -135,12 +135,12 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | function sha1_file(string $filename, bool $raw_output = false): string |
| 137 | 137 | { |
| 138 | - error_clear_last(); |
|
| 139 | - $result = \sha1_file($filename, $raw_output); |
|
| 140 | - if ($result === false) { |
|
| 141 | - throw StringsException::createFromPhpError(); |
|
| 142 | - } |
|
| 143 | - return $result; |
|
| 138 | + error_clear_last(); |
|
| 139 | + $result = \sha1_file($filename, $raw_output); |
|
| 140 | + if ($result === false) { |
|
| 141 | + throw StringsException::createFromPhpError(); |
|
| 142 | + } |
|
| 143 | + return $result; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | function soundex(string $str): string |
| 166 | 166 | { |
| 167 | - error_clear_last(); |
|
| 168 | - $result = \soundex($str); |
|
| 169 | - if ($result === false) { |
|
| 170 | - throw StringsException::createFromPhpError(); |
|
| 171 | - } |
|
| 172 | - return $result; |
|
| 167 | + error_clear_last(); |
|
| 168 | + $result = \soundex($str); |
|
| 169 | + if ($result === false) { |
|
| 170 | + throw StringsException::createFromPhpError(); |
|
| 171 | + } |
|
| 172 | + return $result; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
@@ -466,16 +466,16 @@ discard block |
||
| 466 | 466 | */ |
| 467 | 467 | function sprintf(string $format, ...$params): string |
| 468 | 468 | { |
| 469 | - error_clear_last(); |
|
| 470 | - if ($params !== []) { |
|
| 471 | - $result = \sprintf($format, ...$params); |
|
| 472 | - } else { |
|
| 473 | - $result = \sprintf($format); |
|
| 474 | - } |
|
| 475 | - if ($result === false) { |
|
| 476 | - throw StringsException::createFromPhpError(); |
|
| 477 | - } |
|
| 478 | - return $result; |
|
| 469 | + error_clear_last(); |
|
| 470 | + if ($params !== []) { |
|
| 471 | + $result = \sprintf($format, ...$params); |
|
| 472 | + } else { |
|
| 473 | + $result = \sprintf($format); |
|
| 474 | + } |
|
| 475 | + if ($result === false) { |
|
| 476 | + throw StringsException::createFromPhpError(); |
|
| 477 | + } |
|
| 478 | + return $result; |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | |
@@ -531,16 +531,16 @@ discard block |
||
| 531 | 531 | */ |
| 532 | 532 | function substr(string $string, int $start, int $length = null): string |
| 533 | 533 | { |
| 534 | - error_clear_last(); |
|
| 535 | - if ($length !== null) { |
|
| 536 | - $result = \substr($string, $start, $length); |
|
| 537 | - } else { |
|
| 538 | - $result = \substr($string, $start); |
|
| 539 | - } |
|
| 540 | - if ($result === false) { |
|
| 541 | - throw StringsException::createFromPhpError(); |
|
| 542 | - } |
|
| 543 | - return $result; |
|
| 534 | + error_clear_last(); |
|
| 535 | + if ($length !== null) { |
|
| 536 | + $result = \substr($string, $start, $length); |
|
| 537 | + } else { |
|
| 538 | + $result = \substr($string, $start); |
|
| 539 | + } |
|
| 540 | + if ($result === false) { |
|
| 541 | + throw StringsException::createFromPhpError(); |
|
| 542 | + } |
|
| 543 | + return $result; |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | |
@@ -837,10 +837,10 @@ discard block |
||
| 837 | 837 | */ |
| 838 | 838 | function vsprintf(string $format, array $args): string |
| 839 | 839 | { |
| 840 | - error_clear_last(); |
|
| 841 | - $result = \vsprintf($format, $args); |
|
| 842 | - if ($result === false) { |
|
| 843 | - throw StringsException::createFromPhpError(); |
|
| 844 | - } |
|
| 845 | - return $result; |
|
| 840 | + error_clear_last(); |
|
| 841 | + $result = \vsprintf($format, $args); |
|
| 842 | + if ($result === false) { |
|
| 843 | + throw StringsException::createFromPhpError(); |
|
| 844 | + } |
|
| 845 | + return $result; |
|
| 846 | 846 | } |
@@ -13,9 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | function rpmaddtag(int $tag): void |
| 15 | 15 | { |
| 16 | - error_clear_last(); |
|
| 17 | - $result = \rpmaddtag($tag); |
|
| 18 | - if ($result === false) { |
|
| 19 | - throw RpminfoException::createFromPhpError(); |
|
| 20 | - } |
|
| 16 | + error_clear_last(); |
|
| 17 | + $result = \rpmaddtag($tag); |
|
| 18 | + if ($result === false) { |
|
| 19 | + throw RpminfoException::createFromPhpError(); |
|
| 20 | + } |
|
| 21 | 21 | } |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function ftp_alloc($ftp_stream, int $filesize, string &$result = null): void |
| 19 | 19 | { |
| 20 | - error_clear_last(); |
|
| 21 | - $result = \ftp_alloc($ftp_stream, $filesize, $result); |
|
| 22 | - if ($result === false) { |
|
| 23 | - throw FtpException::createFromPhpError(); |
|
| 24 | - } |
|
| 20 | + error_clear_last(); |
|
| 21 | + $result = \ftp_alloc($ftp_stream, $filesize, $result); |
|
| 22 | + if ($result === false) { |
|
| 23 | + throw FtpException::createFromPhpError(); |
|
| 24 | + } |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | function ftp_append($ftp, string $remote_file, string $local_file, int $mode = FTP_BINARY): void |
| 39 | 39 | { |
| 40 | - error_clear_last(); |
|
| 41 | - $result = \ftp_append($ftp, $remote_file, $local_file, $mode); |
|
| 42 | - if ($result === false) { |
|
| 43 | - throw FtpException::createFromPhpError(); |
|
| 44 | - } |
|
| 40 | + error_clear_last(); |
|
| 41 | + $result = \ftp_append($ftp, $remote_file, $local_file, $mode); |
|
| 42 | + if ($result === false) { |
|
| 43 | + throw FtpException::createFromPhpError(); |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | function ftp_cdup($ftp_stream): void |
| 56 | 56 | { |
| 57 | - error_clear_last(); |
|
| 58 | - $result = \ftp_cdup($ftp_stream); |
|
| 59 | - if ($result === false) { |
|
| 60 | - throw FtpException::createFromPhpError(); |
|
| 61 | - } |
|
| 57 | + error_clear_last(); |
|
| 58 | + $result = \ftp_cdup($ftp_stream); |
|
| 59 | + if ($result === false) { |
|
| 60 | + throw FtpException::createFromPhpError(); |
|
| 61 | + } |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | function ftp_chdir($ftp_stream, string $directory): void |
| 74 | 74 | { |
| 75 | - error_clear_last(); |
|
| 76 | - $result = \ftp_chdir($ftp_stream, $directory); |
|
| 77 | - if ($result === false) { |
|
| 78 | - throw FtpException::createFromPhpError(); |
|
| 79 | - } |
|
| 75 | + error_clear_last(); |
|
| 76 | + $result = \ftp_chdir($ftp_stream, $directory); |
|
| 77 | + if ($result === false) { |
|
| 78 | + throw FtpException::createFromPhpError(); |
|
| 79 | + } |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | function ftp_chmod($ftp_stream, int $mode, string $filename): int |
| 95 | 95 | { |
| 96 | - error_clear_last(); |
|
| 97 | - $result = \ftp_chmod($ftp_stream, $mode, $filename); |
|
| 98 | - if ($result === false) { |
|
| 99 | - throw FtpException::createFromPhpError(); |
|
| 100 | - } |
|
| 101 | - return $result; |
|
| 96 | + error_clear_last(); |
|
| 97 | + $result = \ftp_chmod($ftp_stream, $mode, $filename); |
|
| 98 | + if ($result === false) { |
|
| 99 | + throw FtpException::createFromPhpError(); |
|
| 100 | + } |
|
| 101 | + return $result; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | function ftp_close($ftp_stream): void |
| 114 | 114 | { |
| 115 | - error_clear_last(); |
|
| 116 | - $result = \ftp_close($ftp_stream); |
|
| 117 | - if ($result === false) { |
|
| 118 | - throw FtpException::createFromPhpError(); |
|
| 119 | - } |
|
| 115 | + error_clear_last(); |
|
| 116 | + $result = \ftp_close($ftp_stream); |
|
| 117 | + if ($result === false) { |
|
| 118 | + throw FtpException::createFromPhpError(); |
|
| 119 | + } |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -138,12 +138,12 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | function ftp_connect(string $host, int $port = 21, int $timeout = 90) |
| 140 | 140 | { |
| 141 | - error_clear_last(); |
|
| 142 | - $result = \ftp_connect($host, $port, $timeout); |
|
| 143 | - if ($result === false) { |
|
| 144 | - throw FtpException::createFromPhpError(); |
|
| 145 | - } |
|
| 146 | - return $result; |
|
| 141 | + error_clear_last(); |
|
| 142 | + $result = \ftp_connect($host, $port, $timeout); |
|
| 143 | + if ($result === false) { |
|
| 144 | + throw FtpException::createFromPhpError(); |
|
| 145 | + } |
|
| 146 | + return $result; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | function ftp_delete($ftp_stream, string $path): void |
| 160 | 160 | { |
| 161 | - error_clear_last(); |
|
| 162 | - $result = \ftp_delete($ftp_stream, $path); |
|
| 163 | - if ($result === false) { |
|
| 164 | - throw FtpException::createFromPhpError(); |
|
| 165 | - } |
|
| 161 | + error_clear_last(); |
|
| 162 | + $result = \ftp_delete($ftp_stream, $path); |
|
| 163 | + if ($result === false) { |
|
| 164 | + throw FtpException::createFromPhpError(); |
|
| 165 | + } |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
@@ -181,11 +181,11 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | function ftp_fget($ftp_stream, $handle, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): void |
| 183 | 183 | { |
| 184 | - error_clear_last(); |
|
| 185 | - $result = \ftp_fget($ftp_stream, $handle, $remote_file, $mode, $resumepos); |
|
| 186 | - if ($result === false) { |
|
| 187 | - throw FtpException::createFromPhpError(); |
|
| 188 | - } |
|
| 184 | + error_clear_last(); |
|
| 185 | + $result = \ftp_fget($ftp_stream, $handle, $remote_file, $mode, $resumepos); |
|
| 186 | + if ($result === false) { |
|
| 187 | + throw FtpException::createFromPhpError(); |
|
| 188 | + } |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
@@ -204,11 +204,11 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | function ftp_fput($ftp_stream, string $remote_file, $handle, int $mode = FTP_BINARY, int $startpos = 0): void |
| 206 | 206 | { |
| 207 | - error_clear_last(); |
|
| 208 | - $result = \ftp_fput($ftp_stream, $remote_file, $handle, $mode, $startpos); |
|
| 209 | - if ($result === false) { |
|
| 210 | - throw FtpException::createFromPhpError(); |
|
| 211 | - } |
|
| 207 | + error_clear_last(); |
|
| 208 | + $result = \ftp_fput($ftp_stream, $remote_file, $handle, $mode, $startpos); |
|
| 209 | + if ($result === false) { |
|
| 210 | + throw FtpException::createFromPhpError(); |
|
| 211 | + } |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
@@ -227,11 +227,11 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | function ftp_get($ftp_stream, string $local_file, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): void |
| 229 | 229 | { |
| 230 | - error_clear_last(); |
|
| 231 | - $result = \ftp_get($ftp_stream, $local_file, $remote_file, $mode, $resumepos); |
|
| 232 | - if ($result === false) { |
|
| 233 | - throw FtpException::createFromPhpError(); |
|
| 234 | - } |
|
| 230 | + error_clear_last(); |
|
| 231 | + $result = \ftp_get($ftp_stream, $local_file, $remote_file, $mode, $resumepos); |
|
| 232 | + if ($result === false) { |
|
| 233 | + throw FtpException::createFromPhpError(); |
|
| 234 | + } |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | |
@@ -246,11 +246,11 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | function ftp_login($ftp_stream, string $username, string $password): void |
| 248 | 248 | { |
| 249 | - error_clear_last(); |
|
| 250 | - $result = \ftp_login($ftp_stream, $username, $password); |
|
| 251 | - if ($result === false) { |
|
| 252 | - throw FtpException::createFromPhpError(); |
|
| 253 | - } |
|
| 249 | + error_clear_last(); |
|
| 250 | + $result = \ftp_login($ftp_stream, $username, $password); |
|
| 251 | + if ($result === false) { |
|
| 252 | + throw FtpException::createFromPhpError(); |
|
| 253 | + } |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
@@ -265,12 +265,12 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | function ftp_mkdir($ftp_stream, string $directory): string |
| 267 | 267 | { |
| 268 | - error_clear_last(); |
|
| 269 | - $result = \ftp_mkdir($ftp_stream, $directory); |
|
| 270 | - if ($result === false) { |
|
| 271 | - throw FtpException::createFromPhpError(); |
|
| 272 | - } |
|
| 273 | - return $result; |
|
| 268 | + error_clear_last(); |
|
| 269 | + $result = \ftp_mkdir($ftp_stream, $directory); |
|
| 270 | + if ($result === false) { |
|
| 271 | + throw FtpException::createFromPhpError(); |
|
| 272 | + } |
|
| 273 | + return $result; |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
@@ -285,12 +285,12 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | function ftp_mlsd($ftp_stream, string $directory): array |
| 287 | 287 | { |
| 288 | - error_clear_last(); |
|
| 289 | - $result = \ftp_mlsd($ftp_stream, $directory); |
|
| 290 | - if ($result === false) { |
|
| 291 | - throw FtpException::createFromPhpError(); |
|
| 292 | - } |
|
| 293 | - return $result; |
|
| 288 | + error_clear_last(); |
|
| 289 | + $result = \ftp_mlsd($ftp_stream, $directory); |
|
| 290 | + if ($result === false) { |
|
| 291 | + throw FtpException::createFromPhpError(); |
|
| 292 | + } |
|
| 293 | + return $result; |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
@@ -308,12 +308,12 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | function ftp_nlist($ftp_stream, string $directory): array |
| 310 | 310 | { |
| 311 | - error_clear_last(); |
|
| 312 | - $result = \ftp_nlist($ftp_stream, $directory); |
|
| 313 | - if ($result === false) { |
|
| 314 | - throw FtpException::createFromPhpError(); |
|
| 315 | - } |
|
| 316 | - return $result; |
|
| 311 | + error_clear_last(); |
|
| 312 | + $result = \ftp_nlist($ftp_stream, $directory); |
|
| 313 | + if ($result === false) { |
|
| 314 | + throw FtpException::createFromPhpError(); |
|
| 315 | + } |
|
| 316 | + return $result; |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | |
@@ -333,11 +333,11 @@ discard block |
||
| 333 | 333 | */ |
| 334 | 334 | function ftp_pasv($ftp_stream, bool $pasv): void |
| 335 | 335 | { |
| 336 | - error_clear_last(); |
|
| 337 | - $result = \ftp_pasv($ftp_stream, $pasv); |
|
| 338 | - if ($result === false) { |
|
| 339 | - throw FtpException::createFromPhpError(); |
|
| 340 | - } |
|
| 336 | + error_clear_last(); |
|
| 337 | + $result = \ftp_pasv($ftp_stream, $pasv); |
|
| 338 | + if ($result === false) { |
|
| 339 | + throw FtpException::createFromPhpError(); |
|
| 340 | + } |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | |
@@ -355,11 +355,11 @@ discard block |
||
| 355 | 355 | */ |
| 356 | 356 | function ftp_put($ftp_stream, string $remote_file, string $local_file, int $mode = FTP_BINARY, int $startpos = 0): void |
| 357 | 357 | { |
| 358 | - error_clear_last(); |
|
| 359 | - $result = \ftp_put($ftp_stream, $remote_file, $local_file, $mode, $startpos); |
|
| 360 | - if ($result === false) { |
|
| 361 | - throw FtpException::createFromPhpError(); |
|
| 362 | - } |
|
| 358 | + error_clear_last(); |
|
| 359 | + $result = \ftp_put($ftp_stream, $remote_file, $local_file, $mode, $startpos); |
|
| 360 | + if ($result === false) { |
|
| 361 | + throw FtpException::createFromPhpError(); |
|
| 362 | + } |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | |
@@ -373,12 +373,12 @@ discard block |
||
| 373 | 373 | */ |
| 374 | 374 | function ftp_pwd($ftp_stream): string |
| 375 | 375 | { |
| 376 | - error_clear_last(); |
|
| 377 | - $result = \ftp_pwd($ftp_stream); |
|
| 378 | - if ($result === false) { |
|
| 379 | - throw FtpException::createFromPhpError(); |
|
| 380 | - } |
|
| 381 | - return $result; |
|
| 376 | + error_clear_last(); |
|
| 377 | + $result = \ftp_pwd($ftp_stream); |
|
| 378 | + if ($result === false) { |
|
| 379 | + throw FtpException::createFromPhpError(); |
|
| 380 | + } |
|
| 381 | + return $result; |
|
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | |
@@ -394,11 +394,11 @@ discard block |
||
| 394 | 394 | */ |
| 395 | 395 | function ftp_rename($ftp_stream, string $oldname, string $newname): void |
| 396 | 396 | { |
| 397 | - error_clear_last(); |
|
| 398 | - $result = \ftp_rename($ftp_stream, $oldname, $newname); |
|
| 399 | - if ($result === false) { |
|
| 400 | - throw FtpException::createFromPhpError(); |
|
| 401 | - } |
|
| 397 | + error_clear_last(); |
|
| 398 | + $result = \ftp_rename($ftp_stream, $oldname, $newname); |
|
| 399 | + if ($result === false) { |
|
| 400 | + throw FtpException::createFromPhpError(); |
|
| 401 | + } |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | |
@@ -413,11 +413,11 @@ discard block |
||
| 413 | 413 | */ |
| 414 | 414 | function ftp_rmdir($ftp_stream, string $directory): void |
| 415 | 415 | { |
| 416 | - error_clear_last(); |
|
| 417 | - $result = \ftp_rmdir($ftp_stream, $directory); |
|
| 418 | - if ($result === false) { |
|
| 419 | - throw FtpException::createFromPhpError(); |
|
| 420 | - } |
|
| 416 | + error_clear_last(); |
|
| 417 | + $result = \ftp_rmdir($ftp_stream, $directory); |
|
| 418 | + if ($result === false) { |
|
| 419 | + throw FtpException::createFromPhpError(); |
|
| 420 | + } |
|
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | function ftp_site($ftp_stream, string $command): void |
| 439 | 439 | { |
| 440 | - error_clear_last(); |
|
| 441 | - $result = \ftp_site($ftp_stream, $command); |
|
| 442 | - if ($result === false) { |
|
| 443 | - throw FtpException::createFromPhpError(); |
|
| 444 | - } |
|
| 440 | + error_clear_last(); |
|
| 441 | + $result = \ftp_site($ftp_stream, $command); |
|
| 442 | + if ($result === false) { |
|
| 443 | + throw FtpException::createFromPhpError(); |
|
| 444 | + } |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
@@ -468,12 +468,12 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | function ftp_ssl_connect(string $host, int $port = 21, int $timeout = 90) |
| 470 | 470 | { |
| 471 | - error_clear_last(); |
|
| 472 | - $result = \ftp_ssl_connect($host, $port, $timeout); |
|
| 473 | - if ($result === false) { |
|
| 474 | - throw FtpException::createFromPhpError(); |
|
| 475 | - } |
|
| 476 | - return $result; |
|
| 471 | + error_clear_last(); |
|
| 472 | + $result = \ftp_ssl_connect($host, $port, $timeout); |
|
| 473 | + if ($result === false) { |
|
| 474 | + throw FtpException::createFromPhpError(); |
|
| 475 | + } |
|
| 476 | + return $result; |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | |
@@ -487,10 +487,10 @@ discard block |
||
| 487 | 487 | */ |
| 488 | 488 | function ftp_systype($ftp_stream): string |
| 489 | 489 | { |
| 490 | - error_clear_last(); |
|
| 491 | - $result = \ftp_systype($ftp_stream); |
|
| 492 | - if ($result === false) { |
|
| 493 | - throw FtpException::createFromPhpError(); |
|
| 494 | - } |
|
| 495 | - return $result; |
|
| 490 | + error_clear_last(); |
|
| 491 | + $result = \ftp_systype($ftp_stream); |
|
| 492 | + if ($result === false) { |
|
| 493 | + throw FtpException::createFromPhpError(); |
|
| 494 | + } |
|
| 495 | + return $result; |
|
| 496 | 496 | } |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | function getimagesize(string $filename, array &$imageinfo = null): array |
| 70 | 70 | { |
| 71 | - error_clear_last(); |
|
| 72 | - $result = \getimagesize($filename, $imageinfo); |
|
| 73 | - if ($result === false) { |
|
| 74 | - throw ImageException::createFromPhpError(); |
|
| 75 | - } |
|
| 76 | - return $result; |
|
| 71 | + error_clear_last(); |
|
| 72 | + $result = \getimagesize($filename, $imageinfo); |
|
| 73 | + if ($result === false) { |
|
| 74 | + throw ImageException::createFromPhpError(); |
|
| 75 | + } |
|
| 76 | + return $result; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
@@ -93,17 +93,17 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | function image2wbmp($image, ?string $filename = null, int $foreground = null): void |
| 95 | 95 | { |
| 96 | - error_clear_last(); |
|
| 97 | - if ($foreground !== null) { |
|
| 98 | - $result = \image2wbmp($image, $filename, $foreground); |
|
| 99 | - } elseif ($filename !== null) { |
|
| 100 | - $result = \image2wbmp($image, $filename); |
|
| 101 | - } else { |
|
| 102 | - $result = \image2wbmp($image); |
|
| 103 | - } |
|
| 104 | - if ($result === false) { |
|
| 105 | - throw ImageException::createFromPhpError(); |
|
| 106 | - } |
|
| 96 | + error_clear_last(); |
|
| 97 | + if ($foreground !== null) { |
|
| 98 | + $result = \image2wbmp($image, $filename, $foreground); |
|
| 99 | + } elseif ($filename !== null) { |
|
| 100 | + $result = \image2wbmp($image, $filename); |
|
| 101 | + } else { |
|
| 102 | + $result = \image2wbmp($image); |
|
| 103 | + } |
|
| 104 | + if ($result === false) { |
|
| 105 | + throw ImageException::createFromPhpError(); |
|
| 106 | + } |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
@@ -120,16 +120,16 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | function imageaffine($image, array $affine, array $clip = null) |
| 122 | 122 | { |
| 123 | - error_clear_last(); |
|
| 124 | - if ($clip !== null) { |
|
| 125 | - $result = \imageaffine($image, $affine, $clip); |
|
| 126 | - } else { |
|
| 127 | - $result = \imageaffine($image, $affine); |
|
| 128 | - } |
|
| 129 | - if ($result === false) { |
|
| 130 | - throw ImageException::createFromPhpError(); |
|
| 131 | - } |
|
| 132 | - return $result; |
|
| 123 | + error_clear_last(); |
|
| 124 | + if ($clip !== null) { |
|
| 125 | + $result = \imageaffine($image, $affine, $clip); |
|
| 126 | + } else { |
|
| 127 | + $result = \imageaffine($image, $affine); |
|
| 128 | + } |
|
| 129 | + if ($result === false) { |
|
| 130 | + throw ImageException::createFromPhpError(); |
|
| 131 | + } |
|
| 132 | + return $result; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | function imageaffinematrixconcat(array $m1, array $m2): array |
| 151 | 151 | { |
| 152 | - error_clear_last(); |
|
| 153 | - $result = \imageaffinematrixconcat($m1, $m2); |
|
| 154 | - if ($result === false) { |
|
| 155 | - throw ImageException::createFromPhpError(); |
|
| 156 | - } |
|
| 157 | - return $result; |
|
| 152 | + error_clear_last(); |
|
| 153 | + $result = \imageaffinematrixconcat($m1, $m2); |
|
| 154 | + if ($result === false) { |
|
| 155 | + throw ImageException::createFromPhpError(); |
|
| 156 | + } |
|
| 157 | + return $result; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
@@ -177,16 +177,16 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | function imageaffinematrixget(int $type, $options = null): array |
| 179 | 179 | { |
| 180 | - error_clear_last(); |
|
| 181 | - if ($options !== null) { |
|
| 182 | - $result = \imageaffinematrixget($type, $options); |
|
| 183 | - } else { |
|
| 184 | - $result = \imageaffinematrixget($type); |
|
| 185 | - } |
|
| 186 | - if ($result === false) { |
|
| 187 | - throw ImageException::createFromPhpError(); |
|
| 188 | - } |
|
| 189 | - return $result; |
|
| 180 | + error_clear_last(); |
|
| 181 | + if ($options !== null) { |
|
| 182 | + $result = \imageaffinematrixget($type, $options); |
|
| 183 | + } else { |
|
| 184 | + $result = \imageaffinematrixget($type); |
|
| 185 | + } |
|
| 186 | + if ($result === false) { |
|
| 187 | + throw ImageException::createFromPhpError(); |
|
| 188 | + } |
|
| 189 | + return $result; |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
@@ -211,11 +211,11 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | function imagealphablending($image, bool $blendmode): void |
| 213 | 213 | { |
| 214 | - error_clear_last(); |
|
| 215 | - $result = \imagealphablending($image, $blendmode); |
|
| 216 | - if ($result === false) { |
|
| 217 | - throw ImageException::createFromPhpError(); |
|
| 218 | - } |
|
| 214 | + error_clear_last(); |
|
| 215 | + $result = \imagealphablending($image, $blendmode); |
|
| 216 | + if ($result === false) { |
|
| 217 | + throw ImageException::createFromPhpError(); |
|
| 218 | + } |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
@@ -239,11 +239,11 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | function imageantialias($image, bool $enabled): void |
| 241 | 241 | { |
| 242 | - error_clear_last(); |
|
| 243 | - $result = \imageantialias($image, $enabled); |
|
| 244 | - if ($result === false) { |
|
| 245 | - throw ImageException::createFromPhpError(); |
|
| 246 | - } |
|
| 242 | + error_clear_last(); |
|
| 243 | + $result = \imageantialias($image, $enabled); |
|
| 244 | + if ($result === false) { |
|
| 245 | + throw ImageException::createFromPhpError(); |
|
| 246 | + } |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | |
@@ -267,11 +267,11 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | function imagearc($image, int $cx, int $cy, int $width, int $height, int $start, int $end, int $color): void |
| 269 | 269 | { |
| 270 | - error_clear_last(); |
|
| 271 | - $result = \imagearc($image, $cx, $cy, $width, $height, $start, $end, $color); |
|
| 272 | - if ($result === false) { |
|
| 273 | - throw ImageException::createFromPhpError(); |
|
| 274 | - } |
|
| 270 | + error_clear_last(); |
|
| 271 | + $result = \imagearc($image, $cx, $cy, $width, $height, $start, $end, $color); |
|
| 272 | + if ($result === false) { |
|
| 273 | + throw ImageException::createFromPhpError(); |
|
| 274 | + } |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
@@ -290,11 +290,11 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | function imagebmp($image, $to = null, bool $compressed = true): void |
| 292 | 292 | { |
| 293 | - error_clear_last(); |
|
| 294 | - $result = \imagebmp($image, $to, $compressed); |
|
| 295 | - if ($result === false) { |
|
| 296 | - throw ImageException::createFromPhpError(); |
|
| 297 | - } |
|
| 293 | + error_clear_last(); |
|
| 294 | + $result = \imagebmp($image, $to, $compressed); |
|
| 295 | + if ($result === false) { |
|
| 296 | + throw ImageException::createFromPhpError(); |
|
| 297 | + } |
|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | |
@@ -319,11 +319,11 @@ discard block |
||
| 319 | 319 | */ |
| 320 | 320 | function imagechar($image, int $font, int $x, int $y, string $c, int $color): void |
| 321 | 321 | { |
| 322 | - error_clear_last(); |
|
| 323 | - $result = \imagechar($image, $font, $x, $y, $c, $color); |
|
| 324 | - if ($result === false) { |
|
| 325 | - throw ImageException::createFromPhpError(); |
|
| 326 | - } |
|
| 322 | + error_clear_last(); |
|
| 323 | + $result = \imagechar($image, $font, $x, $y, $c, $color); |
|
| 324 | + if ($result === false) { |
|
| 325 | + throw ImageException::createFromPhpError(); |
|
| 326 | + } |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
@@ -345,11 +345,11 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | function imagecharup($image, int $font, int $x, int $y, string $c, int $color): void |
| 347 | 347 | { |
| 348 | - error_clear_last(); |
|
| 349 | - $result = \imagecharup($image, $font, $x, $y, $c, $color); |
|
| 350 | - if ($result === false) { |
|
| 351 | - throw ImageException::createFromPhpError(); |
|
| 352 | - } |
|
| 348 | + error_clear_last(); |
|
| 349 | + $result = \imagecharup($image, $font, $x, $y, $c, $color); |
|
| 350 | + if ($result === false) { |
|
| 351 | + throw ImageException::createFromPhpError(); |
|
| 352 | + } |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | |
@@ -372,12 +372,12 @@ discard block |
||
| 372 | 372 | */ |
| 373 | 373 | function imagecolorat($image, int $x, int $y): int |
| 374 | 374 | { |
| 375 | - error_clear_last(); |
|
| 376 | - $result = \imagecolorat($image, $x, $y); |
|
| 377 | - if ($result === false) { |
|
| 378 | - throw ImageException::createFromPhpError(); |
|
| 379 | - } |
|
| 380 | - return $result; |
|
| 375 | + error_clear_last(); |
|
| 376 | + $result = \imagecolorat($image, $x, $y); |
|
| 377 | + if ($result === false) { |
|
| 378 | + throw ImageException::createFromPhpError(); |
|
| 379 | + } |
|
| 380 | + return $result; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
@@ -394,11 +394,11 @@ discard block |
||
| 394 | 394 | */ |
| 395 | 395 | function imagecolordeallocate($image, int $color): void |
| 396 | 396 | { |
| 397 | - error_clear_last(); |
|
| 398 | - $result = \imagecolordeallocate($image, $color); |
|
| 399 | - if ($result === false) { |
|
| 400 | - throw ImageException::createFromPhpError(); |
|
| 401 | - } |
|
| 397 | + error_clear_last(); |
|
| 398 | + $result = \imagecolordeallocate($image, $color); |
|
| 399 | + if ($result === false) { |
|
| 400 | + throw ImageException::createFromPhpError(); |
|
| 401 | + } |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | |
@@ -413,11 +413,11 @@ discard block |
||
| 413 | 413 | */ |
| 414 | 414 | function imagecolormatch($image1, $image2): void |
| 415 | 415 | { |
| 416 | - error_clear_last(); |
|
| 417 | - $result = \imagecolormatch($image1, $image2); |
|
| 418 | - if ($result === false) { |
|
| 419 | - throw ImageException::createFromPhpError(); |
|
| 420 | - } |
|
| 416 | + error_clear_last(); |
|
| 417 | + $result = \imagecolormatch($image1, $image2); |
|
| 418 | + if ($result === false) { |
|
| 419 | + throw ImageException::createFromPhpError(); |
|
| 420 | + } |
|
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | |
@@ -435,11 +435,11 @@ discard block |
||
| 435 | 435 | */ |
| 436 | 436 | function imageconvolution($image, array $matrix, float $div, float $offset): void |
| 437 | 437 | { |
| 438 | - error_clear_last(); |
|
| 439 | - $result = \imageconvolution($image, $matrix, $div, $offset); |
|
| 440 | - if ($result === false) { |
|
| 441 | - throw ImageException::createFromPhpError(); |
|
| 442 | - } |
|
| 438 | + error_clear_last(); |
|
| 439 | + $result = \imageconvolution($image, $matrix, $div, $offset); |
|
| 440 | + if ($result === false) { |
|
| 441 | + throw ImageException::createFromPhpError(); |
|
| 442 | + } |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | |
@@ -465,11 +465,11 @@ discard block |
||
| 465 | 465 | */ |
| 466 | 466 | function imagecopy($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h): void |
| 467 | 467 | { |
| 468 | - error_clear_last(); |
|
| 469 | - $result = \imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); |
|
| 470 | - if ($result === false) { |
|
| 471 | - throw ImageException::createFromPhpError(); |
|
| 472 | - } |
|
| 468 | + error_clear_last(); |
|
| 469 | + $result = \imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); |
|
| 470 | + if ($result === false) { |
|
| 471 | + throw ImageException::createFromPhpError(); |
|
| 472 | + } |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | |
@@ -501,11 +501,11 @@ discard block |
||
| 501 | 501 | */ |
| 502 | 502 | function imagecopymerge($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): void |
| 503 | 503 | { |
| 504 | - error_clear_last(); |
|
| 505 | - $result = \imagecopymerge($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct); |
|
| 506 | - if ($result === false) { |
|
| 507 | - throw ImageException::createFromPhpError(); |
|
| 508 | - } |
|
| 504 | + error_clear_last(); |
|
| 505 | + $result = \imagecopymerge($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct); |
|
| 506 | + if ($result === false) { |
|
| 507 | + throw ImageException::createFromPhpError(); |
|
| 508 | + } |
|
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | |
@@ -541,11 +541,11 @@ discard block |
||
| 541 | 541 | */ |
| 542 | 542 | function imagecopymergegray($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): void |
| 543 | 543 | { |
| 544 | - error_clear_last(); |
|
| 545 | - $result = \imagecopymergegray($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct); |
|
| 546 | - if ($result === false) { |
|
| 547 | - throw ImageException::createFromPhpError(); |
|
| 548 | - } |
|
| 544 | + error_clear_last(); |
|
| 545 | + $result = \imagecopymergegray($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct); |
|
| 546 | + if ($result === false) { |
|
| 547 | + throw ImageException::createFromPhpError(); |
|
| 548 | + } |
|
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | |
@@ -586,11 +586,11 @@ discard block |
||
| 586 | 586 | */ |
| 587 | 587 | function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h): void |
| 588 | 588 | { |
| 589 | - error_clear_last(); |
|
| 590 | - $result = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); |
|
| 591 | - if ($result === false) { |
|
| 592 | - throw ImageException::createFromPhpError(); |
|
| 593 | - } |
|
| 589 | + error_clear_last(); |
|
| 590 | + $result = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); |
|
| 591 | + if ($result === false) { |
|
| 592 | + throw ImageException::createFromPhpError(); |
|
| 593 | + } |
|
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | |
@@ -631,11 +631,11 @@ discard block |
||
| 631 | 631 | */ |
| 632 | 632 | function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h): void |
| 633 | 633 | { |
| 634 | - error_clear_last(); |
|
| 635 | - $result = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); |
|
| 636 | - if ($result === false) { |
|
| 637 | - throw ImageException::createFromPhpError(); |
|
| 638 | - } |
|
| 634 | + error_clear_last(); |
|
| 635 | + $result = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); |
|
| 636 | + if ($result === false) { |
|
| 637 | + throw ImageException::createFromPhpError(); |
|
| 638 | + } |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | |
@@ -659,12 +659,12 @@ discard block |
||
| 659 | 659 | */ |
| 660 | 660 | function imagecreate(int $width, int $height) |
| 661 | 661 | { |
| 662 | - error_clear_last(); |
|
| 663 | - $result = \imagecreate($width, $height); |
|
| 664 | - if ($result === false) { |
|
| 665 | - throw ImageException::createFromPhpError(); |
|
| 666 | - } |
|
| 667 | - return $result; |
|
| 662 | + error_clear_last(); |
|
| 663 | + $result = \imagecreate($width, $height); |
|
| 664 | + if ($result === false) { |
|
| 665 | + throw ImageException::createFromPhpError(); |
|
| 666 | + } |
|
| 667 | + return $result; |
|
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | |
@@ -679,12 +679,12 @@ discard block |
||
| 679 | 679 | */ |
| 680 | 680 | function imagecreatefrombmp(string $filename) |
| 681 | 681 | { |
| 682 | - error_clear_last(); |
|
| 683 | - $result = \imagecreatefrombmp($filename); |
|
| 684 | - if ($result === false) { |
|
| 685 | - throw ImageException::createFromPhpError(); |
|
| 686 | - } |
|
| 687 | - return $result; |
|
| 682 | + error_clear_last(); |
|
| 683 | + $result = \imagecreatefrombmp($filename); |
|
| 684 | + if ($result === false) { |
|
| 685 | + throw ImageException::createFromPhpError(); |
|
| 686 | + } |
|
| 687 | + return $result; |
|
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | |
@@ -698,12 +698,12 @@ discard block |
||
| 698 | 698 | */ |
| 699 | 699 | function imagecreatefromgd(string $filename) |
| 700 | 700 | { |
| 701 | - error_clear_last(); |
|
| 702 | - $result = \imagecreatefromgd($filename); |
|
| 703 | - if ($result === false) { |
|
| 704 | - throw ImageException::createFromPhpError(); |
|
| 705 | - } |
|
| 706 | - return $result; |
|
| 701 | + error_clear_last(); |
|
| 702 | + $result = \imagecreatefromgd($filename); |
|
| 703 | + if ($result === false) { |
|
| 704 | + throw ImageException::createFromPhpError(); |
|
| 705 | + } |
|
| 706 | + return $result; |
|
| 707 | 707 | } |
| 708 | 708 | |
| 709 | 709 | |
@@ -717,12 +717,12 @@ discard block |
||
| 717 | 717 | */ |
| 718 | 718 | function imagecreatefromgd2(string $filename) |
| 719 | 719 | { |
| 720 | - error_clear_last(); |
|
| 721 | - $result = \imagecreatefromgd2($filename); |
|
| 722 | - if ($result === false) { |
|
| 723 | - throw ImageException::createFromPhpError(); |
|
| 724 | - } |
|
| 725 | - return $result; |
|
| 720 | + error_clear_last(); |
|
| 721 | + $result = \imagecreatefromgd2($filename); |
|
| 722 | + if ($result === false) { |
|
| 723 | + throw ImageException::createFromPhpError(); |
|
| 724 | + } |
|
| 725 | + return $result; |
|
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | |
@@ -740,12 +740,12 @@ discard block |
||
| 740 | 740 | */ |
| 741 | 741 | function imagecreatefromgd2part(string $filename, int $srcX, int $srcY, int $width, int $height) |
| 742 | 742 | { |
| 743 | - error_clear_last(); |
|
| 744 | - $result = \imagecreatefromgd2part($filename, $srcX, $srcY, $width, $height); |
|
| 745 | - if ($result === false) { |
|
| 746 | - throw ImageException::createFromPhpError(); |
|
| 747 | - } |
|
| 748 | - return $result; |
|
| 743 | + error_clear_last(); |
|
| 744 | + $result = \imagecreatefromgd2part($filename, $srcX, $srcY, $width, $height); |
|
| 745 | + if ($result === false) { |
|
| 746 | + throw ImageException::createFromPhpError(); |
|
| 747 | + } |
|
| 748 | + return $result; |
|
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | |
@@ -760,12 +760,12 @@ discard block |
||
| 760 | 760 | */ |
| 761 | 761 | function imagecreatefromgif(string $filename) |
| 762 | 762 | { |
| 763 | - error_clear_last(); |
|
| 764 | - $result = \imagecreatefromgif($filename); |
|
| 765 | - if ($result === false) { |
|
| 766 | - throw ImageException::createFromPhpError(); |
|
| 767 | - } |
|
| 768 | - return $result; |
|
| 763 | + error_clear_last(); |
|
| 764 | + $result = \imagecreatefromgif($filename); |
|
| 765 | + if ($result === false) { |
|
| 766 | + throw ImageException::createFromPhpError(); |
|
| 767 | + } |
|
| 768 | + return $result; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | |
@@ -780,12 +780,12 @@ discard block |
||
| 780 | 780 | */ |
| 781 | 781 | function imagecreatefromjpeg(string $filename) |
| 782 | 782 | { |
| 783 | - error_clear_last(); |
|
| 784 | - $result = \imagecreatefromjpeg($filename); |
|
| 785 | - if ($result === false) { |
|
| 786 | - throw ImageException::createFromPhpError(); |
|
| 787 | - } |
|
| 788 | - return $result; |
|
| 783 | + error_clear_last(); |
|
| 784 | + $result = \imagecreatefromjpeg($filename); |
|
| 785 | + if ($result === false) { |
|
| 786 | + throw ImageException::createFromPhpError(); |
|
| 787 | + } |
|
| 788 | + return $result; |
|
| 789 | 789 | } |
| 790 | 790 | |
| 791 | 791 | |
@@ -800,12 +800,12 @@ discard block |
||
| 800 | 800 | */ |
| 801 | 801 | function imagecreatefrompng(string $filename) |
| 802 | 802 | { |
| 803 | - error_clear_last(); |
|
| 804 | - $result = \imagecreatefrompng($filename); |
|
| 805 | - if ($result === false) { |
|
| 806 | - throw ImageException::createFromPhpError(); |
|
| 807 | - } |
|
| 808 | - return $result; |
|
| 803 | + error_clear_last(); |
|
| 804 | + $result = \imagecreatefrompng($filename); |
|
| 805 | + if ($result === false) { |
|
| 806 | + throw ImageException::createFromPhpError(); |
|
| 807 | + } |
|
| 808 | + return $result; |
|
| 809 | 809 | } |
| 810 | 810 | |
| 811 | 811 | |
@@ -820,12 +820,12 @@ discard block |
||
| 820 | 820 | */ |
| 821 | 821 | function imagecreatefromwbmp(string $filename) |
| 822 | 822 | { |
| 823 | - error_clear_last(); |
|
| 824 | - $result = \imagecreatefromwbmp($filename); |
|
| 825 | - if ($result === false) { |
|
| 826 | - throw ImageException::createFromPhpError(); |
|
| 827 | - } |
|
| 828 | - return $result; |
|
| 823 | + error_clear_last(); |
|
| 824 | + $result = \imagecreatefromwbmp($filename); |
|
| 825 | + if ($result === false) { |
|
| 826 | + throw ImageException::createFromPhpError(); |
|
| 827 | + } |
|
| 828 | + return $result; |
|
| 829 | 829 | } |
| 830 | 830 | |
| 831 | 831 | |
@@ -840,12 +840,12 @@ discard block |
||
| 840 | 840 | */ |
| 841 | 841 | function imagecreatefromwebp(string $filename) |
| 842 | 842 | { |
| 843 | - error_clear_last(); |
|
| 844 | - $result = \imagecreatefromwebp($filename); |
|
| 845 | - if ($result === false) { |
|
| 846 | - throw ImageException::createFromPhpError(); |
|
| 847 | - } |
|
| 848 | - return $result; |
|
| 843 | + error_clear_last(); |
|
| 844 | + $result = \imagecreatefromwebp($filename); |
|
| 845 | + if ($result === false) { |
|
| 846 | + throw ImageException::createFromPhpError(); |
|
| 847 | + } |
|
| 848 | + return $result; |
|
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | |
@@ -860,12 +860,12 @@ discard block |
||
| 860 | 860 | */ |
| 861 | 861 | function imagecreatefromxbm(string $filename) |
| 862 | 862 | { |
| 863 | - error_clear_last(); |
|
| 864 | - $result = \imagecreatefromxbm($filename); |
|
| 865 | - if ($result === false) { |
|
| 866 | - throw ImageException::createFromPhpError(); |
|
| 867 | - } |
|
| 868 | - return $result; |
|
| 863 | + error_clear_last(); |
|
| 864 | + $result = \imagecreatefromxbm($filename); |
|
| 865 | + if ($result === false) { |
|
| 866 | + throw ImageException::createFromPhpError(); |
|
| 867 | + } |
|
| 868 | + return $result; |
|
| 869 | 869 | } |
| 870 | 870 | |
| 871 | 871 | |
@@ -880,12 +880,12 @@ discard block |
||
| 880 | 880 | */ |
| 881 | 881 | function imagecreatefromxpm(string $filename) |
| 882 | 882 | { |
| 883 | - error_clear_last(); |
|
| 884 | - $result = \imagecreatefromxpm($filename); |
|
| 885 | - if ($result === false) { |
|
| 886 | - throw ImageException::createFromPhpError(); |
|
| 887 | - } |
|
| 888 | - return $result; |
|
| 883 | + error_clear_last(); |
|
| 884 | + $result = \imagecreatefromxpm($filename); |
|
| 885 | + if ($result === false) { |
|
| 886 | + throw ImageException::createFromPhpError(); |
|
| 887 | + } |
|
| 888 | + return $result; |
|
| 889 | 889 | } |
| 890 | 890 | |
| 891 | 891 | |
@@ -901,12 +901,12 @@ discard block |
||
| 901 | 901 | */ |
| 902 | 902 | function imagecreatetruecolor(int $width, int $height) |
| 903 | 903 | { |
| 904 | - error_clear_last(); |
|
| 905 | - $result = \imagecreatetruecolor($width, $height); |
|
| 906 | - if ($result === false) { |
|
| 907 | - throw ImageException::createFromPhpError(); |
|
| 908 | - } |
|
| 909 | - return $result; |
|
| 904 | + error_clear_last(); |
|
| 905 | + $result = \imagecreatetruecolor($width, $height); |
|
| 906 | + if ($result === false) { |
|
| 907 | + throw ImageException::createFromPhpError(); |
|
| 908 | + } |
|
| 909 | + return $result; |
|
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | |
@@ -925,12 +925,12 @@ discard block |
||
| 925 | 925 | */ |
| 926 | 926 | function imagecrop($image, array $rect) |
| 927 | 927 | { |
| 928 | - error_clear_last(); |
|
| 929 | - $result = \imagecrop($image, $rect); |
|
| 930 | - if ($result === false) { |
|
| 931 | - throw ImageException::createFromPhpError(); |
|
| 932 | - } |
|
| 933 | - return $result; |
|
| 928 | + error_clear_last(); |
|
| 929 | + $result = \imagecrop($image, $rect); |
|
| 930 | + if ($result === false) { |
|
| 931 | + throw ImageException::createFromPhpError(); |
|
| 932 | + } |
|
| 933 | + return $result; |
|
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | |
@@ -950,12 +950,12 @@ discard block |
||
| 950 | 950 | */ |
| 951 | 951 | function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = .5, int $color = -1) |
| 952 | 952 | { |
| 953 | - error_clear_last(); |
|
| 954 | - $result = \imagecropauto($image, $mode, $threshold, $color); |
|
| 955 | - if ($result === false) { |
|
| 956 | - throw ImageException::createFromPhpError(); |
|
| 957 | - } |
|
| 958 | - return $result; |
|
| 953 | + error_clear_last(); |
|
| 954 | + $result = \imagecropauto($image, $mode, $threshold, $color); |
|
| 955 | + if ($result === false) { |
|
| 956 | + throw ImageException::createFromPhpError(); |
|
| 957 | + } |
|
| 958 | + return $result; |
|
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | |
@@ -976,11 +976,11 @@ discard block |
||
| 976 | 976 | */ |
| 977 | 977 | function imagedashedline($image, int $x1, int $y1, int $x2, int $y2, int $color): void |
| 978 | 978 | { |
| 979 | - error_clear_last(); |
|
| 980 | - $result = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); |
|
| 981 | - if ($result === false) { |
|
| 982 | - throw ImageException::createFromPhpError(); |
|
| 983 | - } |
|
| 979 | + error_clear_last(); |
|
| 980 | + $result = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); |
|
| 981 | + if ($result === false) { |
|
| 982 | + throw ImageException::createFromPhpError(); |
|
| 983 | + } |
|
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | |
@@ -995,11 +995,11 @@ discard block |
||
| 995 | 995 | */ |
| 996 | 996 | function imagedestroy($image): void |
| 997 | 997 | { |
| 998 | - error_clear_last(); |
|
| 999 | - $result = \imagedestroy($image); |
|
| 1000 | - if ($result === false) { |
|
| 1001 | - throw ImageException::createFromPhpError(); |
|
| 1002 | - } |
|
| 998 | + error_clear_last(); |
|
| 999 | + $result = \imagedestroy($image); |
|
| 1000 | + if ($result === false) { |
|
| 1001 | + throw ImageException::createFromPhpError(); |
|
| 1002 | + } |
|
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | |
@@ -1018,11 +1018,11 @@ discard block |
||
| 1018 | 1018 | */ |
| 1019 | 1019 | function imageellipse($image, int $cx, int $cy, int $width, int $height, int $color): void |
| 1020 | 1020 | { |
| 1021 | - error_clear_last(); |
|
| 1022 | - $result = \imageellipse($image, $cx, $cy, $width, $height, $color); |
|
| 1023 | - if ($result === false) { |
|
| 1024 | - throw ImageException::createFromPhpError(); |
|
| 1025 | - } |
|
| 1021 | + error_clear_last(); |
|
| 1022 | + $result = \imageellipse($image, $cx, $cy, $width, $height, $color); |
|
| 1023 | + if ($result === false) { |
|
| 1024 | + throw ImageException::createFromPhpError(); |
|
| 1025 | + } |
|
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | 1028 | |
@@ -1041,11 +1041,11 @@ discard block |
||
| 1041 | 1041 | */ |
| 1042 | 1042 | function imagefill($image, int $x, int $y, int $color): void |
| 1043 | 1043 | { |
| 1044 | - error_clear_last(); |
|
| 1045 | - $result = \imagefill($image, $x, $y, $color); |
|
| 1046 | - if ($result === false) { |
|
| 1047 | - throw ImageException::createFromPhpError(); |
|
| 1048 | - } |
|
| 1044 | + error_clear_last(); |
|
| 1045 | + $result = \imagefill($image, $x, $y, $color); |
|
| 1046 | + if ($result === false) { |
|
| 1047 | + throw ImageException::createFromPhpError(); |
|
| 1048 | + } |
|
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | 1051 | |
@@ -1085,11 +1085,11 @@ discard block |
||
| 1085 | 1085 | */ |
| 1086 | 1086 | function imagefilledarc($image, int $cx, int $cy, int $width, int $height, int $start, int $end, int $color, int $style): void |
| 1087 | 1087 | { |
| 1088 | - error_clear_last(); |
|
| 1089 | - $result = \imagefilledarc($image, $cx, $cy, $width, $height, $start, $end, $color, $style); |
|
| 1090 | - if ($result === false) { |
|
| 1091 | - throw ImageException::createFromPhpError(); |
|
| 1092 | - } |
|
| 1088 | + error_clear_last(); |
|
| 1089 | + $result = \imagefilledarc($image, $cx, $cy, $width, $height, $start, $end, $color, $style); |
|
| 1090 | + if ($result === false) { |
|
| 1091 | + throw ImageException::createFromPhpError(); |
|
| 1092 | + } |
|
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | |
@@ -1109,11 +1109,11 @@ discard block |
||
| 1109 | 1109 | */ |
| 1110 | 1110 | function imagefilledellipse($image, int $cx, int $cy, int $width, int $height, int $color): void |
| 1111 | 1111 | { |
| 1112 | - error_clear_last(); |
|
| 1113 | - $result = \imagefilledellipse($image, $cx, $cy, $width, $height, $color); |
|
| 1114 | - if ($result === false) { |
|
| 1115 | - throw ImageException::createFromPhpError(); |
|
| 1116 | - } |
|
| 1112 | + error_clear_last(); |
|
| 1113 | + $result = \imagefilledellipse($image, $cx, $cy, $width, $height, $color); |
|
| 1114 | + if ($result === false) { |
|
| 1115 | + throw ImageException::createFromPhpError(); |
|
| 1116 | + } |
|
| 1117 | 1117 | } |
| 1118 | 1118 | |
| 1119 | 1119 | |
@@ -1132,11 +1132,11 @@ discard block |
||
| 1132 | 1132 | */ |
| 1133 | 1133 | function imagefilledpolygon($image, array $points, int $num_points, int $color): void |
| 1134 | 1134 | { |
| 1135 | - error_clear_last(); |
|
| 1136 | - $result = \imagefilledpolygon($image, $points, $num_points, $color); |
|
| 1137 | - if ($result === false) { |
|
| 1138 | - throw ImageException::createFromPhpError(); |
|
| 1139 | - } |
|
| 1135 | + error_clear_last(); |
|
| 1136 | + $result = \imagefilledpolygon($image, $points, $num_points, $color); |
|
| 1137 | + if ($result === false) { |
|
| 1138 | + throw ImageException::createFromPhpError(); |
|
| 1139 | + } |
|
| 1140 | 1140 | } |
| 1141 | 1141 | |
| 1142 | 1142 | |
@@ -1157,11 +1157,11 @@ discard block |
||
| 1157 | 1157 | */ |
| 1158 | 1158 | function imagefilledrectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void |
| 1159 | 1159 | { |
| 1160 | - error_clear_last(); |
|
| 1161 | - $result = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); |
|
| 1162 | - if ($result === false) { |
|
| 1163 | - throw ImageException::createFromPhpError(); |
|
| 1164 | - } |
|
| 1160 | + error_clear_last(); |
|
| 1161 | + $result = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); |
|
| 1162 | + if ($result === false) { |
|
| 1163 | + throw ImageException::createFromPhpError(); |
|
| 1164 | + } |
|
| 1165 | 1165 | } |
| 1166 | 1166 | |
| 1167 | 1167 | |
@@ -1183,11 +1183,11 @@ discard block |
||
| 1183 | 1183 | */ |
| 1184 | 1184 | function imagefilltoborder($image, int $x, int $y, int $border, int $color): void |
| 1185 | 1185 | { |
| 1186 | - error_clear_last(); |
|
| 1187 | - $result = \imagefilltoborder($image, $x, $y, $border, $color); |
|
| 1188 | - if ($result === false) { |
|
| 1189 | - throw ImageException::createFromPhpError(); |
|
| 1190 | - } |
|
| 1186 | + error_clear_last(); |
|
| 1187 | + $result = \imagefilltoborder($image, $x, $y, $border, $color); |
|
| 1188 | + if ($result === false) { |
|
| 1189 | + throw ImageException::createFromPhpError(); |
|
| 1190 | + } |
|
| 1191 | 1191 | } |
| 1192 | 1192 | |
| 1193 | 1193 | |
@@ -1369,21 +1369,21 @@ discard block |
||
| 1369 | 1369 | */ |
| 1370 | 1370 | function imagefilter($image, int $filtertype, int $arg1 = null, int $arg2 = null, int $arg3 = null, int $arg4 = null): void |
| 1371 | 1371 | { |
| 1372 | - error_clear_last(); |
|
| 1373 | - if ($arg4 !== null) { |
|
| 1374 | - $result = \imagefilter($image, $filtertype, $arg1, $arg2, $arg3, $arg4); |
|
| 1375 | - } elseif ($arg3 !== null) { |
|
| 1376 | - $result = \imagefilter($image, $filtertype, $arg1, $arg2, $arg3); |
|
| 1377 | - } elseif ($arg2 !== null) { |
|
| 1378 | - $result = \imagefilter($image, $filtertype, $arg1, $arg2); |
|
| 1379 | - } elseif ($arg1 !== null) { |
|
| 1380 | - $result = \imagefilter($image, $filtertype, $arg1); |
|
| 1381 | - } else { |
|
| 1382 | - $result = \imagefilter($image, $filtertype); |
|
| 1383 | - } |
|
| 1384 | - if ($result === false) { |
|
| 1385 | - throw ImageException::createFromPhpError(); |
|
| 1386 | - } |
|
| 1372 | + error_clear_last(); |
|
| 1373 | + if ($arg4 !== null) { |
|
| 1374 | + $result = \imagefilter($image, $filtertype, $arg1, $arg2, $arg3, $arg4); |
|
| 1375 | + } elseif ($arg3 !== null) { |
|
| 1376 | + $result = \imagefilter($image, $filtertype, $arg1, $arg2, $arg3); |
|
| 1377 | + } elseif ($arg2 !== null) { |
|
| 1378 | + $result = \imagefilter($image, $filtertype, $arg1, $arg2); |
|
| 1379 | + } elseif ($arg1 !== null) { |
|
| 1380 | + $result = \imagefilter($image, $filtertype, $arg1); |
|
| 1381 | + } else { |
|
| 1382 | + $result = \imagefilter($image, $filtertype); |
|
| 1383 | + } |
|
| 1384 | + if ($result === false) { |
|
| 1385 | + throw ImageException::createFromPhpError(); |
|
| 1386 | + } |
|
| 1387 | 1387 | } |
| 1388 | 1388 | |
| 1389 | 1389 | |
@@ -1430,11 +1430,11 @@ discard block |
||
| 1430 | 1430 | */ |
| 1431 | 1431 | function imageflip($image, int $mode): void |
| 1432 | 1432 | { |
| 1433 | - error_clear_last(); |
|
| 1434 | - $result = \imageflip($image, $mode); |
|
| 1435 | - if ($result === false) { |
|
| 1436 | - throw ImageException::createFromPhpError(); |
|
| 1437 | - } |
|
| 1433 | + error_clear_last(); |
|
| 1434 | + $result = \imageflip($image, $mode); |
|
| 1435 | + if ($result === false) { |
|
| 1436 | + throw ImageException::createFromPhpError(); |
|
| 1437 | + } |
|
| 1438 | 1438 | } |
| 1439 | 1439 | |
| 1440 | 1440 | |
@@ -1451,11 +1451,11 @@ discard block |
||
| 1451 | 1451 | */ |
| 1452 | 1452 | function imagegammacorrect($image, float $inputgamma, float $outputgamma): void |
| 1453 | 1453 | { |
| 1454 | - error_clear_last(); |
|
| 1455 | - $result = \imagegammacorrect($image, $inputgamma, $outputgamma); |
|
| 1456 | - if ($result === false) { |
|
| 1457 | - throw ImageException::createFromPhpError(); |
|
| 1458 | - } |
|
| 1454 | + error_clear_last(); |
|
| 1455 | + $result = \imagegammacorrect($image, $inputgamma, $outputgamma); |
|
| 1456 | + if ($result === false) { |
|
| 1457 | + throw ImageException::createFromPhpError(); |
|
| 1458 | + } |
|
| 1459 | 1459 | } |
| 1460 | 1460 | |
| 1461 | 1461 | |
@@ -1470,11 +1470,11 @@ discard block |
||
| 1470 | 1470 | */ |
| 1471 | 1471 | function imagegd($image, $to = null): void |
| 1472 | 1472 | { |
| 1473 | - error_clear_last(); |
|
| 1474 | - $result = \imagegd($image, $to); |
|
| 1475 | - if ($result === false) { |
|
| 1476 | - throw ImageException::createFromPhpError(); |
|
| 1477 | - } |
|
| 1473 | + error_clear_last(); |
|
| 1474 | + $result = \imagegd($image, $to); |
|
| 1475 | + if ($result === false) { |
|
| 1476 | + throw ImageException::createFromPhpError(); |
|
| 1477 | + } |
|
| 1478 | 1478 | } |
| 1479 | 1479 | |
| 1480 | 1480 | |
@@ -1493,11 +1493,11 @@ discard block |
||
| 1493 | 1493 | */ |
| 1494 | 1494 | function imagegd2($image, $to = null, int $chunk_size = 128, int $type = IMG_GD2_RAW): void |
| 1495 | 1495 | { |
| 1496 | - error_clear_last(); |
|
| 1497 | - $result = \imagegd2($image, $to, $chunk_size, $type); |
|
| 1498 | - if ($result === false) { |
|
| 1499 | - throw ImageException::createFromPhpError(); |
|
| 1500 | - } |
|
| 1496 | + error_clear_last(); |
|
| 1497 | + $result = \imagegd2($image, $to, $chunk_size, $type); |
|
| 1498 | + if ($result === false) { |
|
| 1499 | + throw ImageException::createFromPhpError(); |
|
| 1500 | + } |
|
| 1501 | 1501 | } |
| 1502 | 1502 | |
| 1503 | 1503 | |
@@ -1521,11 +1521,11 @@ discard block |
||
| 1521 | 1521 | */ |
| 1522 | 1522 | function imagegif($image, $to = null): void |
| 1523 | 1523 | { |
| 1524 | - error_clear_last(); |
|
| 1525 | - $result = \imagegif($image, $to); |
|
| 1526 | - if ($result === false) { |
|
| 1527 | - throw ImageException::createFromPhpError(); |
|
| 1528 | - } |
|
| 1524 | + error_clear_last(); |
|
| 1525 | + $result = \imagegif($image, $to); |
|
| 1526 | + if ($result === false) { |
|
| 1527 | + throw ImageException::createFromPhpError(); |
|
| 1528 | + } |
|
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | 1531 | |
@@ -1538,12 +1538,12 @@ discard block |
||
| 1538 | 1538 | */ |
| 1539 | 1539 | function imagegrabscreen() |
| 1540 | 1540 | { |
| 1541 | - error_clear_last(); |
|
| 1542 | - $result = \imagegrabscreen(); |
|
| 1543 | - if ($result === false) { |
|
| 1544 | - throw ImageException::createFromPhpError(); |
|
| 1545 | - } |
|
| 1546 | - return $result; |
|
| 1541 | + error_clear_last(); |
|
| 1542 | + $result = \imagegrabscreen(); |
|
| 1543 | + if ($result === false) { |
|
| 1544 | + throw ImageException::createFromPhpError(); |
|
| 1545 | + } |
|
| 1546 | + return $result; |
|
| 1547 | 1547 | } |
| 1548 | 1548 | |
| 1549 | 1549 | |
@@ -1558,12 +1558,12 @@ discard block |
||
| 1558 | 1558 | */ |
| 1559 | 1559 | function imagegrabwindow(int $window_handle, int $client_area = 0) |
| 1560 | 1560 | { |
| 1561 | - error_clear_last(); |
|
| 1562 | - $result = \imagegrabwindow($window_handle, $client_area); |
|
| 1563 | - if ($result === false) { |
|
| 1564 | - throw ImageException::createFromPhpError(); |
|
| 1565 | - } |
|
| 1566 | - return $result; |
|
| 1561 | + error_clear_last(); |
|
| 1562 | + $result = \imagegrabwindow($window_handle, $client_area); |
|
| 1563 | + if ($result === false) { |
|
| 1564 | + throw ImageException::createFromPhpError(); |
|
| 1565 | + } |
|
| 1566 | + return $result; |
|
| 1567 | 1567 | } |
| 1568 | 1568 | |
| 1569 | 1569 | |
@@ -1582,11 +1582,11 @@ discard block |
||
| 1582 | 1582 | */ |
| 1583 | 1583 | function imagejpeg($image, $to = null, int $quality = -1): void |
| 1584 | 1584 | { |
| 1585 | - error_clear_last(); |
|
| 1586 | - $result = \imagejpeg($image, $to, $quality); |
|
| 1587 | - if ($result === false) { |
|
| 1588 | - throw ImageException::createFromPhpError(); |
|
| 1589 | - } |
|
| 1585 | + error_clear_last(); |
|
| 1586 | + $result = \imagejpeg($image, $to, $quality); |
|
| 1587 | + if ($result === false) { |
|
| 1588 | + throw ImageException::createFromPhpError(); |
|
| 1589 | + } |
|
| 1590 | 1590 | } |
| 1591 | 1591 | |
| 1592 | 1592 | |
@@ -1647,11 +1647,11 @@ discard block |
||
| 1647 | 1647 | */ |
| 1648 | 1648 | function imagelayereffect($image, int $effect): void |
| 1649 | 1649 | { |
| 1650 | - error_clear_last(); |
|
| 1651 | - $result = \imagelayereffect($image, $effect); |
|
| 1652 | - if ($result === false) { |
|
| 1653 | - throw ImageException::createFromPhpError(); |
|
| 1654 | - } |
|
| 1650 | + error_clear_last(); |
|
| 1651 | + $result = \imagelayereffect($image, $effect); |
|
| 1652 | + if ($result === false) { |
|
| 1653 | + throw ImageException::createFromPhpError(); |
|
| 1654 | + } |
|
| 1655 | 1655 | } |
| 1656 | 1656 | |
| 1657 | 1657 | |
@@ -1670,11 +1670,11 @@ discard block |
||
| 1670 | 1670 | */ |
| 1671 | 1671 | function imageline($image, int $x1, int $y1, int $x2, int $y2, int $color): void |
| 1672 | 1672 | { |
| 1673 | - error_clear_last(); |
|
| 1674 | - $result = \imageline($image, $x1, $y1, $x2, $y2, $color); |
|
| 1675 | - if ($result === false) { |
|
| 1676 | - throw ImageException::createFromPhpError(); |
|
| 1677 | - } |
|
| 1673 | + error_clear_last(); |
|
| 1674 | + $result = \imageline($image, $x1, $y1, $x2, $y2, $color); |
|
| 1675 | + if ($result === false) { |
|
| 1676 | + throw ImageException::createFromPhpError(); |
|
| 1677 | + } |
|
| 1678 | 1678 | } |
| 1679 | 1679 | |
| 1680 | 1680 | |
@@ -1737,12 +1737,12 @@ discard block |
||
| 1737 | 1737 | */ |
| 1738 | 1738 | function imageloadfont(string $file): int |
| 1739 | 1739 | { |
| 1740 | - error_clear_last(); |
|
| 1741 | - $result = \imageloadfont($file); |
|
| 1742 | - if ($result === false) { |
|
| 1743 | - throw ImageException::createFromPhpError(); |
|
| 1744 | - } |
|
| 1745 | - return $result; |
|
| 1740 | + error_clear_last(); |
|
| 1741 | + $result = \imageloadfont($file); |
|
| 1742 | + if ($result === false) { |
|
| 1743 | + throw ImageException::createFromPhpError(); |
|
| 1744 | + } |
|
| 1745 | + return $result; |
|
| 1746 | 1746 | } |
| 1747 | 1747 | |
| 1748 | 1748 | |
@@ -1783,11 +1783,11 @@ discard block |
||
| 1783 | 1783 | */ |
| 1784 | 1784 | function imageopenpolygon($image, array $points, int $num_points, int $color): void |
| 1785 | 1785 | { |
| 1786 | - error_clear_last(); |
|
| 1787 | - $result = \imageopenpolygon($image, $points, $num_points, $color); |
|
| 1788 | - if ($result === false) { |
|
| 1789 | - throw ImageException::createFromPhpError(); |
|
| 1790 | - } |
|
| 1786 | + error_clear_last(); |
|
| 1787 | + $result = \imageopenpolygon($image, $points, $num_points, $color); |
|
| 1788 | + if ($result === false) { |
|
| 1789 | + throw ImageException::createFromPhpError(); |
|
| 1790 | + } |
|
| 1791 | 1791 | } |
| 1792 | 1792 | |
| 1793 | 1793 | |
@@ -1815,11 +1815,11 @@ discard block |
||
| 1815 | 1815 | */ |
| 1816 | 1816 | function imagepng($image, $to = null, int $quality = -1, int $filters = -1): void |
| 1817 | 1817 | { |
| 1818 | - error_clear_last(); |
|
| 1819 | - $result = \imagepng($image, $to, $quality, $filters); |
|
| 1820 | - if ($result === false) { |
|
| 1821 | - throw ImageException::createFromPhpError(); |
|
| 1822 | - } |
|
| 1818 | + error_clear_last(); |
|
| 1819 | + $result = \imagepng($image, $to, $quality, $filters); |
|
| 1820 | + if ($result === false) { |
|
| 1821 | + throw ImageException::createFromPhpError(); |
|
| 1822 | + } |
|
| 1823 | 1823 | } |
| 1824 | 1824 | |
| 1825 | 1825 | |
@@ -1859,11 +1859,11 @@ discard block |
||
| 1859 | 1859 | */ |
| 1860 | 1860 | function imagepolygon($image, array $points, int $num_points, int $color): void |
| 1861 | 1861 | { |
| 1862 | - error_clear_last(); |
|
| 1863 | - $result = \imagepolygon($image, $points, $num_points, $color); |
|
| 1864 | - if ($result === false) { |
|
| 1865 | - throw ImageException::createFromPhpError(); |
|
| 1866 | - } |
|
| 1862 | + error_clear_last(); |
|
| 1863 | + $result = \imagepolygon($image, $points, $num_points, $color); |
|
| 1864 | + if ($result === false) { |
|
| 1865 | + throw ImageException::createFromPhpError(); |
|
| 1866 | + } |
|
| 1867 | 1867 | } |
| 1868 | 1868 | |
| 1869 | 1869 | |
@@ -1884,11 +1884,11 @@ discard block |
||
| 1884 | 1884 | */ |
| 1885 | 1885 | function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void |
| 1886 | 1886 | { |
| 1887 | - error_clear_last(); |
|
| 1888 | - $result = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); |
|
| 1889 | - if ($result === false) { |
|
| 1890 | - throw ImageException::createFromPhpError(); |
|
| 1891 | - } |
|
| 1887 | + error_clear_last(); |
|
| 1888 | + $result = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); |
|
| 1889 | + if ($result === false) { |
|
| 1890 | + throw ImageException::createFromPhpError(); |
|
| 1891 | + } |
|
| 1892 | 1892 | } |
| 1893 | 1893 | |
| 1894 | 1894 | |
@@ -1911,12 +1911,12 @@ discard block |
||
| 1911 | 1911 | */ |
| 1912 | 1912 | function imagerotate($image, float $angle, int $bgd_color, int $dummy = 0) |
| 1913 | 1913 | { |
| 1914 | - error_clear_last(); |
|
| 1915 | - $result = \imagerotate($image, $angle, $bgd_color, $dummy); |
|
| 1916 | - if ($result === false) { |
|
| 1917 | - throw ImageException::createFromPhpError(); |
|
| 1918 | - } |
|
| 1919 | - return $result; |
|
| 1914 | + error_clear_last(); |
|
| 1915 | + $result = \imagerotate($image, $angle, $bgd_color, $dummy); |
|
| 1916 | + if ($result === false) { |
|
| 1917 | + throw ImageException::createFromPhpError(); |
|
| 1918 | + } |
|
| 1919 | + return $result; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | |
| 1922 | 1922 | |
@@ -1936,11 +1936,11 @@ discard block |
||
| 1936 | 1936 | */ |
| 1937 | 1937 | function imagesavealpha($image, bool $saveflag): void |
| 1938 | 1938 | { |
| 1939 | - error_clear_last(); |
|
| 1940 | - $result = \imagesavealpha($image, $saveflag); |
|
| 1941 | - if ($result === false) { |
|
| 1942 | - throw ImageException::createFromPhpError(); |
|
| 1943 | - } |
|
| 1939 | + error_clear_last(); |
|
| 1940 | + $result = \imagesavealpha($image, $saveflag); |
|
| 1941 | + if ($result === false) { |
|
| 1942 | + throw ImageException::createFromPhpError(); |
|
| 1943 | + } |
|
| 1944 | 1944 | } |
| 1945 | 1945 | |
| 1946 | 1946 | |
@@ -1969,12 +1969,12 @@ discard block |
||
| 1969 | 1969 | */ |
| 1970 | 1970 | function imagescale($image, int $new_width, int $new_height = -1, int $mode = IMG_BILINEAR_FIXED) |
| 1971 | 1971 | { |
| 1972 | - error_clear_last(); |
|
| 1973 | - $result = \imagescale($image, $new_width, $new_height, $mode); |
|
| 1974 | - if ($result === false) { |
|
| 1975 | - throw ImageException::createFromPhpError(); |
|
| 1976 | - } |
|
| 1977 | - return $result; |
|
| 1972 | + error_clear_last(); |
|
| 1973 | + $result = \imagescale($image, $new_width, $new_height, $mode); |
|
| 1974 | + if ($result === false) { |
|
| 1975 | + throw ImageException::createFromPhpError(); |
|
| 1976 | + } |
|
| 1977 | + return $result; |
|
| 1978 | 1978 | } |
| 1979 | 1979 | |
| 1980 | 1980 | |
@@ -1993,11 +1993,11 @@ discard block |
||
| 1993 | 1993 | */ |
| 1994 | 1994 | function imagesetbrush($image, $brush): void |
| 1995 | 1995 | { |
| 1996 | - error_clear_last(); |
|
| 1997 | - $result = \imagesetbrush($image, $brush); |
|
| 1998 | - if ($result === false) { |
|
| 1999 | - throw ImageException::createFromPhpError(); |
|
| 2000 | - } |
|
| 1996 | + error_clear_last(); |
|
| 1997 | + $result = \imagesetbrush($image, $brush); |
|
| 1998 | + if ($result === false) { |
|
| 1999 | + throw ImageException::createFromPhpError(); |
|
| 2000 | + } |
|
| 2001 | 2001 | } |
| 2002 | 2002 | |
| 2003 | 2003 | |
@@ -2016,11 +2016,11 @@ discard block |
||
| 2016 | 2016 | */ |
| 2017 | 2017 | function imagesetclip($im, int $x1, int $y1, int $x2, int $y2): void |
| 2018 | 2018 | { |
| 2019 | - error_clear_last(); |
|
| 2020 | - $result = \imagesetclip($im, $x1, $y1, $x2, $y2); |
|
| 2021 | - if ($result === false) { |
|
| 2022 | - throw ImageException::createFromPhpError(); |
|
| 2023 | - } |
|
| 2019 | + error_clear_last(); |
|
| 2020 | + $result = \imagesetclip($im, $x1, $y1, $x2, $y2); |
|
| 2021 | + if ($result === false) { |
|
| 2022 | + throw ImageException::createFromPhpError(); |
|
| 2023 | + } |
|
| 2024 | 2024 | } |
| 2025 | 2025 | |
| 2026 | 2026 | |
@@ -2143,11 +2143,11 @@ discard block |
||
| 2143 | 2143 | */ |
| 2144 | 2144 | function imagesetinterpolation($image, int $method = IMG_BILINEAR_FIXED): void |
| 2145 | 2145 | { |
| 2146 | - error_clear_last(); |
|
| 2147 | - $result = \imagesetinterpolation($image, $method); |
|
| 2148 | - if ($result === false) { |
|
| 2149 | - throw ImageException::createFromPhpError(); |
|
| 2150 | - } |
|
| 2146 | + error_clear_last(); |
|
| 2147 | + $result = \imagesetinterpolation($image, $method); |
|
| 2148 | + if ($result === false) { |
|
| 2149 | + throw ImageException::createFromPhpError(); |
|
| 2150 | + } |
|
| 2151 | 2151 | } |
| 2152 | 2152 | |
| 2153 | 2153 | |
@@ -2165,11 +2165,11 @@ discard block |
||
| 2165 | 2165 | */ |
| 2166 | 2166 | function imagesetpixel($image, int $x, int $y, int $color): void |
| 2167 | 2167 | { |
| 2168 | - error_clear_last(); |
|
| 2169 | - $result = \imagesetpixel($image, $x, $y, $color); |
|
| 2170 | - if ($result === false) { |
|
| 2171 | - throw ImageException::createFromPhpError(); |
|
| 2172 | - } |
|
| 2168 | + error_clear_last(); |
|
| 2169 | + $result = \imagesetpixel($image, $x, $y, $color); |
|
| 2170 | + if ($result === false) { |
|
| 2171 | + throw ImageException::createFromPhpError(); |
|
| 2172 | + } |
|
| 2173 | 2173 | } |
| 2174 | 2174 | |
| 2175 | 2175 | |
@@ -2191,11 +2191,11 @@ discard block |
||
| 2191 | 2191 | */ |
| 2192 | 2192 | function imagesetstyle($image, array $style): void |
| 2193 | 2193 | { |
| 2194 | - error_clear_last(); |
|
| 2195 | - $result = \imagesetstyle($image, $style); |
|
| 2196 | - if ($result === false) { |
|
| 2197 | - throw ImageException::createFromPhpError(); |
|
| 2198 | - } |
|
| 2194 | + error_clear_last(); |
|
| 2195 | + $result = \imagesetstyle($image, $style); |
|
| 2196 | + if ($result === false) { |
|
| 2197 | + throw ImageException::createFromPhpError(); |
|
| 2198 | + } |
|
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | 2201 | |
@@ -2212,11 +2212,11 @@ discard block |
||
| 2212 | 2212 | */ |
| 2213 | 2213 | function imagesetthickness($image, int $thickness): void |
| 2214 | 2214 | { |
| 2215 | - error_clear_last(); |
|
| 2216 | - $result = \imagesetthickness($image, $thickness); |
|
| 2217 | - if ($result === false) { |
|
| 2218 | - throw ImageException::createFromPhpError(); |
|
| 2219 | - } |
|
| 2215 | + error_clear_last(); |
|
| 2216 | + $result = \imagesetthickness($image, $thickness); |
|
| 2217 | + if ($result === false) { |
|
| 2218 | + throw ImageException::createFromPhpError(); |
|
| 2219 | + } |
|
| 2220 | 2220 | } |
| 2221 | 2221 | |
| 2222 | 2222 | |
@@ -2239,11 +2239,11 @@ discard block |
||
| 2239 | 2239 | */ |
| 2240 | 2240 | function imagesettile($image, $tile): void |
| 2241 | 2241 | { |
| 2242 | - error_clear_last(); |
|
| 2243 | - $result = \imagesettile($image, $tile); |
|
| 2244 | - if ($result === false) { |
|
| 2245 | - throw ImageException::createFromPhpError(); |
|
| 2246 | - } |
|
| 2242 | + error_clear_last(); |
|
| 2243 | + $result = \imagesettile($image, $tile); |
|
| 2244 | + if ($result === false) { |
|
| 2245 | + throw ImageException::createFromPhpError(); |
|
| 2246 | + } |
|
| 2247 | 2247 | } |
| 2248 | 2248 | |
| 2249 | 2249 | |
@@ -2264,11 +2264,11 @@ discard block |
||
| 2264 | 2264 | */ |
| 2265 | 2265 | function imagestring($image, int $font, int $x, int $y, string $string, int $color): void |
| 2266 | 2266 | { |
| 2267 | - error_clear_last(); |
|
| 2268 | - $result = \imagestring($image, $font, $x, $y, $string, $color); |
|
| 2269 | - if ($result === false) { |
|
| 2270 | - throw ImageException::createFromPhpError(); |
|
| 2271 | - } |
|
| 2267 | + error_clear_last(); |
|
| 2268 | + $result = \imagestring($image, $font, $x, $y, $string, $color); |
|
| 2269 | + if ($result === false) { |
|
| 2270 | + throw ImageException::createFromPhpError(); |
|
| 2271 | + } |
|
| 2272 | 2272 | } |
| 2273 | 2273 | |
| 2274 | 2274 | |
@@ -2290,11 +2290,11 @@ discard block |
||
| 2290 | 2290 | */ |
| 2291 | 2291 | function imagestringup($image, int $font, int $x, int $y, string $string, int $color): void |
| 2292 | 2292 | { |
| 2293 | - error_clear_last(); |
|
| 2294 | - $result = \imagestringup($image, $font, $x, $y, $string, $color); |
|
| 2295 | - if ($result === false) { |
|
| 2296 | - throw ImageException::createFromPhpError(); |
|
| 2297 | - } |
|
| 2293 | + error_clear_last(); |
|
| 2294 | + $result = \imagestringup($image, $font, $x, $y, $string, $color); |
|
| 2295 | + if ($result === false) { |
|
| 2296 | + throw ImageException::createFromPhpError(); |
|
| 2297 | + } |
|
| 2298 | 2298 | } |
| 2299 | 2299 | |
| 2300 | 2300 | |
@@ -2309,12 +2309,12 @@ discard block |
||
| 2309 | 2309 | */ |
| 2310 | 2310 | function imagesx($image): int |
| 2311 | 2311 | { |
| 2312 | - error_clear_last(); |
|
| 2313 | - $result = \imagesx($image); |
|
| 2314 | - if ($result === false) { |
|
| 2315 | - throw ImageException::createFromPhpError(); |
|
| 2316 | - } |
|
| 2317 | - return $result; |
|
| 2312 | + error_clear_last(); |
|
| 2313 | + $result = \imagesx($image); |
|
| 2314 | + if ($result === false) { |
|
| 2315 | + throw ImageException::createFromPhpError(); |
|
| 2316 | + } |
|
| 2317 | + return $result; |
|
| 2318 | 2318 | } |
| 2319 | 2319 | |
| 2320 | 2320 | |
@@ -2329,12 +2329,12 @@ discard block |
||
| 2329 | 2329 | */ |
| 2330 | 2330 | function imagesy($image): int |
| 2331 | 2331 | { |
| 2332 | - error_clear_last(); |
|
| 2333 | - $result = \imagesy($image); |
|
| 2334 | - if ($result === false) { |
|
| 2335 | - throw ImageException::createFromPhpError(); |
|
| 2336 | - } |
|
| 2337 | - return $result; |
|
| 2332 | + error_clear_last(); |
|
| 2333 | + $result = \imagesy($image); |
|
| 2334 | + if ($result === false) { |
|
| 2335 | + throw ImageException::createFromPhpError(); |
|
| 2336 | + } |
|
| 2337 | + return $result; |
|
| 2338 | 2338 | } |
| 2339 | 2339 | |
| 2340 | 2340 | |
@@ -2359,11 +2359,11 @@ discard block |
||
| 2359 | 2359 | */ |
| 2360 | 2360 | function imagetruecolortopalette($image, bool $dither, int $ncolors): void |
| 2361 | 2361 | { |
| 2362 | - error_clear_last(); |
|
| 2363 | - $result = \imagetruecolortopalette($image, $dither, $ncolors); |
|
| 2364 | - if ($result === false) { |
|
| 2365 | - throw ImageException::createFromPhpError(); |
|
| 2366 | - } |
|
| 2362 | + error_clear_last(); |
|
| 2363 | + $result = \imagetruecolortopalette($image, $dither, $ncolors); |
|
| 2364 | + if ($result === false) { |
|
| 2365 | + throw ImageException::createFromPhpError(); |
|
| 2366 | + } |
|
| 2367 | 2367 | } |
| 2368 | 2368 | |
| 2369 | 2369 | |
@@ -2453,12 +2453,12 @@ discard block |
||
| 2453 | 2453 | */ |
| 2454 | 2454 | function imagettfbbox(float $size, float $angle, string $fontfile, string $text): array |
| 2455 | 2455 | { |
| 2456 | - error_clear_last(); |
|
| 2457 | - $result = \imagettfbbox($size, $angle, $fontfile, $text); |
|
| 2458 | - if ($result === false) { |
|
| 2459 | - throw ImageException::createFromPhpError(); |
|
| 2460 | - } |
|
| 2461 | - return $result; |
|
| 2456 | + error_clear_last(); |
|
| 2457 | + $result = \imagettfbbox($size, $angle, $fontfile, $text); |
|
| 2458 | + if ($result === false) { |
|
| 2459 | + throw ImageException::createFromPhpError(); |
|
| 2460 | + } |
|
| 2461 | + return $result; |
|
| 2462 | 2462 | } |
| 2463 | 2463 | |
| 2464 | 2464 | |
@@ -2529,12 +2529,12 @@ discard block |
||
| 2529 | 2529 | */ |
| 2530 | 2530 | function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text): array |
| 2531 | 2531 | { |
| 2532 | - error_clear_last(); |
|
| 2533 | - $result = \imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text); |
|
| 2534 | - if ($result === false) { |
|
| 2535 | - throw ImageException::createFromPhpError(); |
|
| 2536 | - } |
|
| 2537 | - return $result; |
|
| 2532 | + error_clear_last(); |
|
| 2533 | + $result = \imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text); |
|
| 2534 | + if ($result === false) { |
|
| 2535 | + throw ImageException::createFromPhpError(); |
|
| 2536 | + } |
|
| 2537 | + return $result; |
|
| 2538 | 2538 | } |
| 2539 | 2539 | |
| 2540 | 2540 | |
@@ -2553,15 +2553,15 @@ discard block |
||
| 2553 | 2553 | */ |
| 2554 | 2554 | function imagewbmp($image, $to = null, int $foreground = null): void |
| 2555 | 2555 | { |
| 2556 | - error_clear_last(); |
|
| 2557 | - if ($foreground !== null) { |
|
| 2558 | - $result = \imagewbmp($image, $to, $foreground); |
|
| 2559 | - } else { |
|
| 2560 | - $result = \imagewbmp($image, $to); |
|
| 2561 | - } |
|
| 2562 | - if ($result === false) { |
|
| 2563 | - throw ImageException::createFromPhpError(); |
|
| 2564 | - } |
|
| 2556 | + error_clear_last(); |
|
| 2557 | + if ($foreground !== null) { |
|
| 2558 | + $result = \imagewbmp($image, $to, $foreground); |
|
| 2559 | + } else { |
|
| 2560 | + $result = \imagewbmp($image, $to); |
|
| 2561 | + } |
|
| 2562 | + if ($result === false) { |
|
| 2563 | + throw ImageException::createFromPhpError(); |
|
| 2564 | + } |
|
| 2565 | 2565 | } |
| 2566 | 2566 | |
| 2567 | 2567 | |
@@ -2578,11 +2578,11 @@ discard block |
||
| 2578 | 2578 | */ |
| 2579 | 2579 | function imagewebp($image, $to = null, int $quality = 80): void |
| 2580 | 2580 | { |
| 2581 | - error_clear_last(); |
|
| 2582 | - $result = \imagewebp($image, $to, $quality); |
|
| 2583 | - if ($result === false) { |
|
| 2584 | - throw ImageException::createFromPhpError(); |
|
| 2585 | - } |
|
| 2581 | + error_clear_last(); |
|
| 2582 | + $result = \imagewebp($image, $to, $quality); |
|
| 2583 | + if ($result === false) { |
|
| 2584 | + throw ImageException::createFromPhpError(); |
|
| 2585 | + } |
|
| 2586 | 2586 | } |
| 2587 | 2587 | |
| 2588 | 2588 | |
@@ -2608,15 +2608,15 @@ discard block |
||
| 2608 | 2608 | */ |
| 2609 | 2609 | function imagexbm($image, ?string $filename, int $foreground = null): void |
| 2610 | 2610 | { |
| 2611 | - error_clear_last(); |
|
| 2612 | - if ($foreground !== null) { |
|
| 2613 | - $result = \imagexbm($image, $filename, $foreground); |
|
| 2614 | - } else { |
|
| 2615 | - $result = \imagexbm($image, $filename); |
|
| 2616 | - } |
|
| 2617 | - if ($result === false) { |
|
| 2618 | - throw ImageException::createFromPhpError(); |
|
| 2619 | - } |
|
| 2611 | + error_clear_last(); |
|
| 2612 | + if ($foreground !== null) { |
|
| 2613 | + $result = \imagexbm($image, $filename, $foreground); |
|
| 2614 | + } else { |
|
| 2615 | + $result = \imagexbm($image, $filename); |
|
| 2616 | + } |
|
| 2617 | + if ($result === false) { |
|
| 2618 | + throw ImageException::createFromPhpError(); |
|
| 2619 | + } |
|
| 2620 | 2620 | } |
| 2621 | 2621 | |
| 2622 | 2622 | |
@@ -2633,12 +2633,12 @@ discard block |
||
| 2633 | 2633 | */ |
| 2634 | 2634 | function iptcembed(string $iptcdata, string $jpeg_file_name, int $spool = 0) |
| 2635 | 2635 | { |
| 2636 | - error_clear_last(); |
|
| 2637 | - $result = \iptcembed($iptcdata, $jpeg_file_name, $spool); |
|
| 2638 | - if ($result === false) { |
|
| 2639 | - throw ImageException::createFromPhpError(); |
|
| 2640 | - } |
|
| 2641 | - return $result; |
|
| 2636 | + error_clear_last(); |
|
| 2637 | + $result = \iptcembed($iptcdata, $jpeg_file_name, $spool); |
|
| 2638 | + if ($result === false) { |
|
| 2639 | + throw ImageException::createFromPhpError(); |
|
| 2640 | + } |
|
| 2641 | + return $result; |
|
| 2642 | 2642 | } |
| 2643 | 2643 | |
| 2644 | 2644 | |
@@ -2653,12 +2653,12 @@ discard block |
||
| 2653 | 2653 | */ |
| 2654 | 2654 | function iptcparse(string $iptcblock): array |
| 2655 | 2655 | { |
| 2656 | - error_clear_last(); |
|
| 2657 | - $result = \iptcparse($iptcblock); |
|
| 2658 | - if ($result === false) { |
|
| 2659 | - throw ImageException::createFromPhpError(); |
|
| 2660 | - } |
|
| 2661 | - return $result; |
|
| 2656 | + error_clear_last(); |
|
| 2657 | + $result = \iptcparse($iptcblock); |
|
| 2658 | + if ($result === false) { |
|
| 2659 | + throw ImageException::createFromPhpError(); |
|
| 2660 | + } |
|
| 2661 | + return $result; |
|
| 2662 | 2662 | } |
| 2663 | 2663 | |
| 2664 | 2664 | |
@@ -2675,11 +2675,11 @@ discard block |
||
| 2675 | 2675 | */ |
| 2676 | 2676 | function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void |
| 2677 | 2677 | { |
| 2678 | - error_clear_last(); |
|
| 2679 | - $result = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); |
|
| 2680 | - if ($result === false) { |
|
| 2681 | - throw ImageException::createFromPhpError(); |
|
| 2682 | - } |
|
| 2678 | + error_clear_last(); |
|
| 2679 | + $result = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); |
|
| 2680 | + if ($result === false) { |
|
| 2681 | + throw ImageException::createFromPhpError(); |
|
| 2682 | + } |
|
| 2683 | 2683 | } |
| 2684 | 2684 | |
| 2685 | 2685 | |
@@ -2696,9 +2696,9 @@ discard block |
||
| 2696 | 2696 | */ |
| 2697 | 2697 | function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void |
| 2698 | 2698 | { |
| 2699 | - error_clear_last(); |
|
| 2700 | - $result = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); |
|
| 2701 | - if ($result === false) { |
|
| 2702 | - throw ImageException::createFromPhpError(); |
|
| 2703 | - } |
|
| 2699 | + error_clear_last(); |
|
| 2700 | + $result = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); |
|
| 2701 | + if ($result === false) { |
|
| 2702 | + throw ImageException::createFromPhpError(); |
|
| 2703 | + } |
|
| 2704 | 2704 | } |