mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-18 22:50:38 +00:00
84cc3b560f
Its latest update added some new stringencies, resulting in 62 messages. Used `composer fix` to take care of them.
38 lines
887 B
PHP
38 lines
887 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
setlocale(LC_ALL, 'en_US.utf8');
|
|
|
|
function phpunit10ErrorHandler(int $errno, string $errstr, string $filename, int $lineno): bool
|
|
{
|
|
$x = error_reporting() & $errno;
|
|
if (
|
|
in_array(
|
|
$errno,
|
|
[
|
|
E_DEPRECATED,
|
|
E_WARNING,
|
|
E_NOTICE,
|
|
E_USER_DEPRECATED,
|
|
E_USER_NOTICE,
|
|
E_USER_WARNING,
|
|
],
|
|
true
|
|
)
|
|
) {
|
|
if (0 === $x) {
|
|
return true; // message suppressed - stop error handling
|
|
}
|
|
|
|
throw new Exception("$errstr $filename $lineno");
|
|
}
|
|
|
|
return false; // continue error handling
|
|
}
|
|
|
|
if (!method_exists(PHPUnit\Framework\TestCase::class, 'setOutputCallback')) {
|
|
ini_set('error_reporting', (string) E_ALL);
|
|
set_error_handler('phpunit10ErrorHandler');
|
|
}
|