diff options
author | Andrew Dolgov <[email protected]> | 2022-07-12 22:26:21 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-07-12 22:26:21 +0300 |
commit | 80d3db1dcf8fe9ca66d4e3f2e2116d3bc39ae2b4 (patch) | |
tree | 04b33bfb9c9368c4a31e287153abec690b9014e0 /vendor/thecodingmachine/safe/lib/Exceptions | |
parent | 4b6161892000cb2b8392dce92a9cf2cabdf2d20e (diff) |
upgrade idiorm to php8.1-patched version (aaronpk/idiorm)
Diffstat (limited to 'vendor/thecodingmachine/safe/lib/Exceptions')
3 files changed, 14 insertions, 3 deletions
diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php b/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php index 2814066b0..d0dbdb695 100644 --- a/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php +++ b/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php @@ -6,9 +6,9 @@ namespace Safe\Exceptions; class CurlException extends \Exception implements SafeExceptionInterface { /** - * @param resource $ch + * @param \CurlHandle $ch */ - public static function createFromCurlResource($ch): self + public static function createFromPhpError($ch): self { return new self(\curl_error($ch), \curl_errno($ch)); } diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php b/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php index 4300d29e9..d7d5a010d 100644 --- a/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php +++ b/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php @@ -3,7 +3,7 @@ namespace Safe\Exceptions; -class JsonException extends \Exception implements SafeExceptionInterface +class JsonException extends \JsonException implements SafeExceptionInterface { public static function createFromPhpError(): self { diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/SimplexmlException.php b/vendor/thecodingmachine/safe/lib/Exceptions/SimplexmlException.php new file mode 100644 index 000000000..477a9151c --- /dev/null +++ b/vendor/thecodingmachine/safe/lib/Exceptions/SimplexmlException.php @@ -0,0 +1,11 @@ +<?php +namespace Safe\Exceptions; + +class SimplexmlException extends \ErrorException implements SafeExceptionInterface +{ + public static function createFromPhpError(): self + { + $error = \error_get_last(); + return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); + } +} |