Remove used code E_STRICT handling in ErrorException class and update tests to reflect changes. (#20402)

This commit is contained in:
Wilmer Arambula
2025-06-10 04:48:05 -04:00
committed by GitHub
parent ed9de17357
commit 86691e2e48
3 changed files with 2 additions and 10 deletions

View File

@ -7,6 +7,7 @@ Yii Framework 2 Change Log
- Chg #19902: Remove support for CUBRID (mtangoo)
- Chg #19891: Remove XCache and ZendDataCache support (mtangoo)
- Enh #20368: Refactor asset management: Migrate from `Bower` to `NPM` for package dependencies and update related documentation (terabytesoftw)
- Bug #20242: Remove used code `E_STRICT` handling in `ErrorException` class and update tests to reflect changes (terabytesoftw)
2.0.53 under development

View File

@ -130,7 +130,7 @@ class ErrorException extends \ErrorException
E_USER_WARNING => 'PHP User Warning',
E_WARNING => 'PHP Warning',
self::E_HHVM_FATAL_ERROR => 'HHVM Fatal Error',
] + (PHP_VERSION_ID < 80400 ? [E_STRICT => 'PHP Strict Warning'] : []);
];
return $names[$this->getCode()] ?? 'Error';
}

View File

@ -41,13 +41,4 @@ class ErrorExceptionTest extends TestCase
$this->assertEquals(__FUNCTION__, $e->getTrace()[0]['function']);
}
}
public function testStrictError()
{
if (!defined('E_STRICT')) {
$this->markTestSkipped('E_STRICT has been removed.');
}
$e = new ErrorException('', @E_STRICT);
$this->assertEquals(PHP_VERSION_ID < 80400 ? 'PHP Strict Warning' : 'Error', $e->getName());
}
}