Add Safe PHP functions

This commit is contained in:
Alex Cabal 2019-03-07 12:11:50 -06:00
parent 04a956886a
commit 58cc098058
260 changed files with 49458 additions and 45 deletions

View file

@ -0,0 +1,14 @@
<?php
namespace Safe\Exceptions;
abstract class AbstractSafeException extends \ErrorException implements SafeExceptionInterface
{
public static function createFromPhpError(): self
{
$error = error_get_last();
return new static($error['message'], 0, $error['type']);
}
}