Skip to content

Commit

Permalink
Merge branch '8.5' into 9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 19, 2024
2 parents 17f4f13 + d7d8e73 commit bc0b86c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog-9.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil

### Changed

* [#5956](https://github.com/sebastianbergmann/phpunit/issues/5956): Deprecation of the `E_STRICT` constant in PHP 8.4
* Removed `.phpstorm.meta.php` file as methods such as `TestCase::createStub()` use generics / template types for their return types and PhpStorm, for example, uses that information

## [9.6.20] - 2024-07-10
Expand Down
11 changes: 10 additions & 1 deletion src/Util/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use const E_USER_NOTICE;
use const E_USER_WARNING;
use const E_WARNING;
use function defined;
use function error_reporting;
use function restore_error_handler;
use function set_error_handler;
Expand Down Expand Up @@ -93,10 +94,18 @@ public function __invoke(int $errorNumber, string $errorString, string $errorFil
return false;
}

/**
* E_STRICT is deprecated since PHP 8.4.
*
* @see https://github.com/sebastianbergmann/phpunit/issues/5956
*/
if (defined('E_STRICT') && $errorNumber === @E_STRICT) {
$errorNumber = E_NOTICE;
}

switch ($errorNumber) {
case E_NOTICE:
case E_USER_NOTICE:
case E_STRICT:
if (!$this->convertNoticesToExceptions) {
return false;
}
Expand Down

0 comments on commit bc0b86c

Please sign in to comment.