@@ -3,9 +3,9 @@ |
||
| 3 | 3 | |
| 4 | 4 | class YazException extends \ErrorException implements SafeExceptionInterface |
| 5 | 5 | { |
| 6 | - public static function createFromPhpError(): self |
|
| 7 | - { |
|
| 8 | - $error = error_get_last(); |
|
| 9 | - return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | - } |
|
| 6 | + public static function createFromPhpError(): self |
|
| 7 | + { |
|
| 8 | + $error = error_get_last(); |
|
| 9 | + return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | + } |
|
| 11 | 11 | } |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | |
| 4 | 4 | class Bzip2Exception extends \ErrorException implements SafeExceptionInterface |
| 5 | 5 | { |
| 6 | - public static function createFromPhpError(): self |
|
| 7 | - { |
|
| 8 | - $error = error_get_last(); |
|
| 9 | - return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | - } |
|
| 6 | + public static function createFromPhpError(): self |
|
| 7 | + { |
|
| 8 | + $error = error_get_last(); |
|
| 9 | + return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | + } |
|
| 11 | 11 | } |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | |
| 4 | 4 | class FilesystemException extends \ErrorException implements SafeExceptionInterface |
| 5 | 5 | { |
| 6 | - public static function createFromPhpError(): self |
|
| 7 | - { |
|
| 8 | - $error = error_get_last(); |
|
| 9 | - return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | - } |
|
| 6 | + public static function createFromPhpError(): self |
|
| 7 | + { |
|
| 8 | + $error = error_get_last(); |
|
| 9 | + return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | + } |
|
| 11 | 11 | } |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | |
| 4 | 4 | class ImapException extends \ErrorException implements SafeExceptionInterface |
| 5 | 5 | { |
| 6 | - public static function createFromPhpError(): self |
|
| 7 | - { |
|
| 8 | - $error = error_get_last(); |
|
| 9 | - return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | - } |
|
| 6 | + public static function createFromPhpError(): self |
|
| 7 | + { |
|
| 8 | + $error = error_get_last(); |
|
| 9 | + return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | + } |
|
| 11 | 11 | } |
@@ -349,12 +349,12 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | function preg_match_all(string $pattern, string $subject, array &$matches = null, int $flags = PREG_PATTERN_ORDER, int $offset = 0): int |
| 351 | 351 | { |
| 352 | - error_clear_last(); |
|
| 353 | - $result = \preg_match_all($pattern, $subject, $matches, $flags, $offset); |
|
| 354 | - if ($result === false) { |
|
| 355 | - throw PcreException::createFromPhpError(); |
|
| 356 | - } |
|
| 357 | - return $result; |
|
| 352 | + error_clear_last(); |
|
| 353 | + $result = \preg_match_all($pattern, $subject, $matches, $flags, $offset); |
|
| 354 | + if ($result === false) { |
|
| 355 | + throw PcreException::createFromPhpError(); |
|
| 356 | + } |
|
| 357 | + return $result; |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | |
@@ -586,12 +586,12 @@ discard block |
||
| 586 | 586 | */ |
| 587 | 587 | function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int |
| 588 | 588 | { |
| 589 | - error_clear_last(); |
|
| 590 | - $result = \preg_match($pattern, $subject, $matches, $flags, $offset); |
|
| 591 | - if ($result === false) { |
|
| 592 | - throw PcreException::createFromPhpError(); |
|
| 593 | - } |
|
| 594 | - return $result; |
|
| 589 | + error_clear_last(); |
|
| 590 | + $result = \preg_match($pattern, $subject, $matches, $flags, $offset); |
|
| 591 | + if ($result === false) { |
|
| 592 | + throw PcreException::createFromPhpError(); |
|
| 593 | + } |
|
| 594 | + return $result; |
|
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | |
@@ -650,10 +650,10 @@ discard block |
||
| 650 | 650 | */ |
| 651 | 651 | function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array |
| 652 | 652 | { |
| 653 | - error_clear_last(); |
|
| 654 | - $result = \preg_split($pattern, $subject, $limit, $flags); |
|
| 655 | - if ($result === false) { |
|
| 656 | - throw PcreException::createFromPhpError(); |
|
| 657 | - } |
|
| 658 | - return $result; |
|
| 653 | + error_clear_last(); |
|
| 654 | + $result = \preg_split($pattern, $subject, $limit, $flags); |
|
| 655 | + if ($result === false) { |
|
| 656 | + throw PcreException::createFromPhpError(); |
|
| 657 | + } |
|
| 658 | + return $result; |
|
| 659 | 659 | } |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | function jdtounix(int $jday): int |
| 20 | 20 | { |
| 21 | - error_clear_last(); |
|
| 22 | - $result = \jdtounix($jday); |
|
| 23 | - if ($result === false) { |
|
| 24 | - throw CalendarException::createFromPhpError(); |
|
| 25 | - } |
|
| 26 | - return $result; |
|
| 21 | + error_clear_last(); |
|
| 22 | + $result = \jdtounix($jday); |
|
| 23 | + if ($result === false) { |
|
| 24 | + throw CalendarException::createFromPhpError(); |
|
| 25 | + } |
|
| 26 | + return $result; |
|
| 27 | 27 | } |
@@ -17,12 +17,12 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function class_implements($class, bool $autoload = true): array |
| 19 | 19 | { |
| 20 | - error_clear_last(); |
|
| 21 | - $result = \class_implements($class, $autoload); |
|
| 22 | - if ($result === false) { |
|
| 23 | - throw SplException::createFromPhpError(); |
|
| 24 | - } |
|
| 25 | - return $result; |
|
| 20 | + error_clear_last(); |
|
| 21 | + $result = \class_implements($class, $autoload); |
|
| 22 | + if ($result === false) { |
|
| 23 | + throw SplException::createFromPhpError(); |
|
| 24 | + } |
|
| 25 | + return $result; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | function class_parents($class, bool $autoload = true): array |
| 41 | 41 | { |
| 42 | - error_clear_last(); |
|
| 43 | - $result = \class_parents($class, $autoload); |
|
| 44 | - if ($result === false) { |
|
| 45 | - throw SplException::createFromPhpError(); |
|
| 46 | - } |
|
| 47 | - return $result; |
|
| 42 | + error_clear_last(); |
|
| 43 | + $result = \class_parents($class, $autoload); |
|
| 44 | + if ($result === false) { |
|
| 45 | + throw SplException::createFromPhpError(); |
|
| 46 | + } |
|
| 47 | + return $result; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | function class_uses($class, bool $autoload = true): array |
| 64 | 64 | { |
| 65 | - error_clear_last(); |
|
| 66 | - $result = \class_uses($class, $autoload); |
|
| 67 | - if ($result === false) { |
|
| 68 | - throw SplException::createFromPhpError(); |
|
| 69 | - } |
|
| 70 | - return $result; |
|
| 65 | + error_clear_last(); |
|
| 66 | + $result = \class_uses($class, $autoload); |
|
| 67 | + if ($result === false) { |
|
| 68 | + throw SplException::createFromPhpError(); |
|
| 69 | + } |
|
| 70 | + return $result; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | function spl_autoload_register(callable $autoload_function = null, bool $throw = true, bool $prepend = false): void |
| 103 | 103 | { |
| 104 | - error_clear_last(); |
|
| 105 | - if ($prepend !== false) { |
|
| 106 | - $result = \spl_autoload_register($autoload_function, $throw, $prepend); |
|
| 107 | - } elseif ($throw !== true) { |
|
| 108 | - $result = \spl_autoload_register($autoload_function, $throw); |
|
| 109 | - } elseif ($autoload_function !== null) { |
|
| 110 | - $result = \spl_autoload_register($autoload_function); |
|
| 111 | - } else { |
|
| 112 | - $result = \spl_autoload_register(); |
|
| 113 | - } |
|
| 114 | - if ($result === false) { |
|
| 115 | - throw SplException::createFromPhpError(); |
|
| 116 | - } |
|
| 104 | + error_clear_last(); |
|
| 105 | + if ($prepend !== false) { |
|
| 106 | + $result = \spl_autoload_register($autoload_function, $throw, $prepend); |
|
| 107 | + } elseif ($throw !== true) { |
|
| 108 | + $result = \spl_autoload_register($autoload_function, $throw); |
|
| 109 | + } elseif ($autoload_function !== null) { |
|
| 110 | + $result = \spl_autoload_register($autoload_function); |
|
| 111 | + } else { |
|
| 112 | + $result = \spl_autoload_register(); |
|
| 113 | + } |
|
| 114 | + if ($result === false) { |
|
| 115 | + throw SplException::createFromPhpError(); |
|
| 116 | + } |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -131,9 +131,9 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function spl_autoload_unregister($autoload_function): void |
| 133 | 133 | { |
| 134 | - error_clear_last(); |
|
| 135 | - $result = \spl_autoload_unregister($autoload_function); |
|
| 136 | - if ($result === false) { |
|
| 137 | - throw SplException::createFromPhpError(); |
|
| 138 | - } |
|
| 134 | + error_clear_last(); |
|
| 135 | + $result = \spl_autoload_unregister($autoload_function); |
|
| 136 | + if ($result === false) { |
|
| 137 | + throw SplException::createFromPhpError(); |
|
| 138 | + } |
|
| 139 | 139 | } |
@@ -25,12 +25,12 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function iconv_get_encoding(string $type = "all") |
| 27 | 27 | { |
| 28 | - error_clear_last(); |
|
| 29 | - $result = \iconv_get_encoding($type); |
|
| 30 | - if ($result === false) { |
|
| 31 | - throw IconvException::createFromPhpError(); |
|
| 32 | - } |
|
| 33 | - return $result; |
|
| 28 | + error_clear_last(); |
|
| 29 | + $result = \iconv_get_encoding($type); |
|
| 30 | + if ($result === false) { |
|
| 31 | + throw IconvException::createFromPhpError(); |
|
| 32 | + } |
|
| 33 | + return $result; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | function iconv_set_encoding(string $type, string $charset): void |
| 52 | 52 | { |
| 53 | - error_clear_last(); |
|
| 54 | - $result = \iconv_set_encoding($type, $charset); |
|
| 55 | - if ($result === false) { |
|
| 56 | - throw IconvException::createFromPhpError(); |
|
| 57 | - } |
|
| 53 | + error_clear_last(); |
|
| 54 | + $result = \iconv_set_encoding($type, $charset); |
|
| 55 | + if ($result === false) { |
|
| 56 | + throw IconvException::createFromPhpError(); |
|
| 57 | + } |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | function iconv(string $in_charset, string $out_charset, string $str): string |
| 89 | 89 | { |
| 90 | - error_clear_last(); |
|
| 91 | - $result = \iconv($in_charset, $out_charset, $str); |
|
| 92 | - if ($result === false) { |
|
| 93 | - throw IconvException::createFromPhpError(); |
|
| 94 | - } |
|
| 95 | - return $result; |
|
| 90 | + error_clear_last(); |
|
| 91 | + $result = \iconv($in_charset, $out_charset, $str); |
|
| 92 | + if ($result === false) { |
|
| 93 | + throw IconvException::createFromPhpError(); |
|
| 94 | + } |
|
| 95 | + return $result; |
|
| 96 | 96 | } |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | function json_encode($value, int $options = 0, int $depth = 512): string |
| 46 | 46 | { |
| 47 | - error_clear_last(); |
|
| 48 | - $result = \json_encode($value, $options, $depth); |
|
| 49 | - if ($result === false) { |
|
| 50 | - throw JsonException::createFromPhpError(); |
|
| 51 | - } |
|
| 52 | - return $result; |
|
| 47 | + error_clear_last(); |
|
| 48 | + $result = \json_encode($value, $options, $depth); |
|
| 49 | + if ($result === false) { |
|
| 50 | + throw JsonException::createFromPhpError(); |
|
| 51 | + } |
|
| 52 | + return $result; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | function json_last_error_msg(): string |
| 66 | 66 | { |
| 67 | - error_clear_last(); |
|
| 68 | - $result = \json_last_error_msg(); |
|
| 69 | - if ($result === false) { |
|
| 70 | - throw JsonException::createFromPhpError(); |
|
| 71 | - } |
|
| 72 | - return $result; |
|
| 67 | + error_clear_last(); |
|
| 68 | + $result = \json_last_error_msg(); |
|
| 69 | + if ($result === false) { |
|
| 70 | + throw JsonException::createFromPhpError(); |
|
| 71 | + } |
|
| 72 | + return $result; |
|
| 73 | 73 | } |