mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 17:42:29 -04:00
Add Safe PHP functions
This commit is contained in:
parent
04a956886a
commit
58cc098058
260 changed files with 49458 additions and 45 deletions
14
vendor/thecodingmachine/safe/lib/Exceptions/AbstractSafeException.php
vendored
Normal file
14
vendor/thecodingmachine/safe/lib/Exceptions/AbstractSafeException.php
vendored
Normal 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']);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue