PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\errorhandler\ErrorToExceptionHandler Class Reference
+ Collaboration diagram for pocketmine\errorhandler\ErrorToExceptionHandler:

Static Public Member Functions

static clearLastSilencedError ()
 
static getAndClearLastSilencedError ()
 
static getLastSilencedError ()
 
static handle (int $severity, string $message, string $file, int $line)
 
static set (int $levels=E_WARNING|E_NOTICE)
 
static trap (\Closure $closure, int $levels=E_WARNING|E_NOTICE)
 
static trapAndRemoveFalse (\Closure $closure, int $levels=E_WARNING|E_NOTICE)
 

Detailed Description

Definition at line 28 of file ErrorToExceptionHandler.php.

Member Function Documentation

◆ clearLastSilencedError()

static pocketmine\errorhandler\ErrorToExceptionHandler::clearLastSilencedError ( )
static

Definition at line 55 of file ErrorToExceptionHandler.php.

◆ getAndClearLastSilencedError()

static pocketmine\errorhandler\ErrorToExceptionHandler::getAndClearLastSilencedError ( )
static

@phpstan-impure

Definition at line 60 of file ErrorToExceptionHandler.php.

◆ getLastSilencedError()

static pocketmine\errorhandler\ErrorToExceptionHandler::getLastSilencedError ( )
static

Definition at line 48 of file ErrorToExceptionHandler.php.

◆ handle()

static pocketmine\errorhandler\ErrorToExceptionHandler::handle ( int $severity,
string $message,
string $file,
int $line )
static
Exceptions

ErrorException

Definition at line 39 of file ErrorToExceptionHandler.php.

◆ set()

static pocketmine\errorhandler\ErrorToExceptionHandler::set ( int $levels = E_WARNING | E_NOTICE)
static

Shorthand method to set the error-to-exception error handler.

Definition at line 69 of file ErrorToExceptionHandler.php.

◆ trap()

static pocketmine\errorhandler\ErrorToExceptionHandler::trap ( \Closure $closure,
int $levels = E_WARNING | E_NOTICE )
static

Runs the given closure, and converts any E_WARNING or E_NOTICE it triggers to ErrorException, bypassing silence operators or existing error handlers.

@phpstan-template TReturn @phpstan-param \Closure() : TReturn $closure

@phpstan-return TReturn

Exceptions

ErrorException

Definition at line 96 of file ErrorToExceptionHandler.php.

◆ trapAndRemoveFalse()

static pocketmine\errorhandler\ErrorToExceptionHandler::trapAndRemoveFalse ( \Closure $closure,
int $levels = E_WARNING | E_NOTICE )
static

Same as trap(), but removes false from the set of possible return values. Mainly useful for PHPStan to unfalsify the results of stdlib functions that normally return false when emitting warnings.

@phpstan-template TReturn @phpstan-param \Closure() : (TReturn|false) $closure

@phpstan-return TReturn

Exceptions

ErrorException

Definition at line 115 of file ErrorToExceptionHandler.php.


The documentation for this class was generated from the following file: