\Composer\UtilSilencer

Temporarily suppress PHP error reporting, usually warnings and below.

Summary

Methods
Properties
Constants
suppress()
restore()
call()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$stack
N/A

Properties

$stack

$stack : array<mixed,integer>

Type

array<mixed,integer> — Unpop stack

Methods

suppress()

suppress(integer|null  $mask = null) : integer

Suppresses given mask or errors.

Parameters

integer|null $mask

Error levels to suppress, default value NULL indicates all warnings and below.

Returns

integer —

The old error reporting level.

restore()

restore() 

Restores a single state.

call()

call(callable  $callable) : mixed

Calls a specified function while silencing warnings and below.

Future improvement: when PHP requirements are raised add Callable type hint (5.4) and variadic parameters (5.6)

Parameters

callable $callable

Function to execute.

Throws

\Exception

Any exceptions from the callback are rethrown.

Returns

mixed —

Return value of the callback.