MDL-70876 php80: 5th param removed from custom error handlers

It was deprecated in php72 and now it's gone.

Have used this regexp to find all the uses in core:

ag set_error_handler | uniq

And then checked all them manually, that parameter was not
being used in the 3 methods where we are removing it.
This commit is contained in:
Eloy Lafuente (stronk7) 2021-02-11 23:50:41 +01:00
parent 95dd305cc6
commit 08ae245926
3 changed files with 4 additions and 7 deletions

View File

@ -504,10 +504,9 @@ class mock_course_backup_setting extends course_backup_setting {
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param array $errcontext
* @return null
*/
function backup_setting_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
function backup_setting_error_handler($errno, $errstr, $errfile, $errline) {
if ($errno !== E_RECOVERABLE_ERROR) {
// Currently we only want to deal with type hinting errors
return false;

View File

@ -124,10 +124,9 @@ function behat_get_error_string($errtype) {
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param array $errcontext
* @return bool
*/
function behat_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
function behat_error_handler($errno, $errstr, $errfile, $errline) {
// If is preceded by an @ we don't show it.
if (!error_reporting()) {
@ -149,7 +148,7 @@ function behat_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
}
// Using the default one in case there is a fatal catchable error.
default_error_handler($errno, $errstr, $errfile, $errline, $errcontext);
default_error_handler($errno, $errstr, $errfile, $errline);
$errnostr = behat_get_error_string($errno);

View File

@ -419,10 +419,9 @@ function default_exception_handler($ex) {
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param array $errcontext
* @return bool false means use default error handler
*/
function default_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
function default_error_handler($errno, $errstr, $errfile, $errline) {
if ($errno == 4096) {
//fatal catchable error
throw new coding_exception('PHP catchable fatal error', $errstr);