diff options
Diffstat (limited to 'vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php')
-rw-r--r-- | vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php b/vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php new file mode 100644 index 000000000..3eec244c6 --- /dev/null +++ b/vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php @@ -0,0 +1,11 @@ +<?php +namespace Safe\Exceptions; + +class PosixException 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); + } +} |