/var/www/vhosts/ihelp.ro/httpdocs/vendor/phpunit/phpunit/src/Util
NameSizeModeActions
Annotation/-0755rm
Log/-0755rm
PHP/-0755rm
TestDox/-0755rm
Xml/-0755rm
Blacklist.php9440644editdlrm
Cloner.php7510644editdlrm
Color.php43040644editdlrm
ErrorHandler.php40580644editdlrm
Exception.php4790644editdlrm
ExcludeList.php57710644editdlrm
FileLoader.php25120644editdlrm
Filesystem.php10700644editdlrm
Filter.php34250644editdlrm
GlobalState.php88590644editdlrm
InvalidDataSetException.php4930644editdlrm
Json.php29190644editdlrm
Printer.php27210644editdlrm
Reflection.php16780644editdlrm
RegularExpression.php7630644editdlrm
Test.php257090644editdlrm
TextTestListRenderer.php14610644editdlrm
Type.php9270644editdlrm
VersionComparisonOperator.php14960644editdlrm
XdebugFilterScriptGenerator.php18320644editdlrm
Xml.php55100644editdlrm
XmlTestListRenderer.php27560644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/phpunit/phpunit/src/Util/ErrorHandler.php (4058B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Util; use const E_DEPRECATED; use const E_NOTICE; use const E_STRICT; use const E_USER_DEPRECATED; use const E_USER_NOTICE; use const E_USER_WARNING; use const E_WARNING; use function error_reporting; use function restore_error_handler; use function set_error_handler; use PHPUnit\Framework\Error\Deprecated; use PHPUnit\Framework\Error\Error; use PHPUnit\Framework\Error\Notice; use PHPUnit\Framework\Error\Warning; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ErrorHandler { /** * @var bool */ private $convertDeprecationsToExceptions; /** * @var bool */ private $convertErrorsToExceptions; /** * @var bool */ private $convertNoticesToExceptions; /** * @var bool */ private $convertWarningsToExceptions; /** * @var bool */ private $registered = false; public static function invokeIgnoringWarnings(callable $callable) { set_error_handler( static function ($errorNumber, $errorString) { if ($errorNumber === E_WARNING) { return; } return false; }, ); $result = $callable(); restore_error_handler(); return $result; } public function __construct(bool $convertDeprecationsToExceptions, bool $convertErrorsToExceptions, bool $convertNoticesToExceptions, bool $convertWarningsToExceptions) { $this->convertDeprecationsToExceptions = $convertDeprecationsToExceptions; $this->convertErrorsToExceptions = $convertErrorsToExceptions; $this->convertNoticesToExceptions = $convertNoticesToExceptions; $this->convertWarningsToExceptions = $convertWarningsToExceptions; } public function __invoke(int $errorNumber, string $errorString, string $errorFile, int $errorLine): bool { /* * Do not raise an exception when the error suppression operator (@) was used. * * @see https://github.com/sebastianbergmann/phpunit/issues/3739 */ if (!($errorNumber & error_reporting())) { return false; } switch ($errorNumber) { case E_NOTICE: case E_USER_NOTICE: case E_STRICT: if (!$this->convertNoticesToExceptions) { return false; } throw new Notice($errorString, $errorNumber, $errorFile, $errorLine); case E_WARNING: case E_USER_WARNING: if (!$this->convertWarningsToExceptions) { return false; } throw new Warning($errorString, $errorNumber, $errorFile, $errorLine); case E_DEPRECATED: case E_USER_DEPRECATED: if (!$this->convertDeprecationsToExceptions) { return false; } throw new Deprecated($errorString, $errorNumber, $errorFile, $errorLine); default: if (!$this->convertErrorsToExceptions) { return false; } throw new Error($errorString, $errorNumber, $errorFile, $errorLine); } } public function register(): void { if ($this->registered) { return; } $oldErrorHandler = set_error_handler($this); if ($oldErrorHandler !== null) { restore_error_handler(); return; } $this->registered = true; } public function unregister(): void { if (!$this->registered) { return; } restore_error_handler(); } }