summaryrefslogtreecommitdiff
path: root/vendor/thecodingmachine/safe/generated/Exceptions/SodiumException.php
blob: f33ec049e61f5b6f1265b202f5f9181c0d5c402d (plain)
1
2
3
4
5
6
7
8
9
10
11
<?php
namespace Safe\Exceptions;

class SodiumException 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);
    }
}