function Silencer::suppress
Suppresses given mask or errors.
Parameters
int|null $mask Error levels to suppress, default value NULL indicates all warnings and below.:
Return value
int The old error reporting level.
3 calls to Silencer::suppress()
- Application::hintCommonErrors in vendor/
composer/ composer/ src/ Composer/ Console/ Application.php - HttpDownloader::getExceptionHints in vendor/
composer/ composer/ src/ Composer/ Util/ HttpDownloader.php - @internal
- Silencer::call in vendor/
composer/ composer/ src/ Composer/ Util/ Silencer.php - Calls a specified function while silencing warnings and below.
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Silencer.php, line 33
Class
- Silencer
- Temporarily suppress PHP error reporting, usually warnings and below.
Namespace
Composer\UtilCode
public static function suppress(?int $mask = null) : int {
if (!isset($mask)) {
$mask = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED;
}
$old = error_reporting();
self::$stack[] = $old;
error_reporting($old & ~$mask);
return $old;
}