Skip to content

Commit

Permalink
Update error handler for php 7.2
Browse files Browse the repository at this point in the history
According to the php documentation the "context" parameter to the
error handler has been deprecated:
https://www.php.net/manual/en/function.set-error-handler.php

Let's move on and get ready for a newer php version (debian bullseye has 7.4).

This in one small step to get ready for php8. See ganglia#361
  • Loading branch information
jh23453 authored Mar 6, 2022
1 parent 3d707eb commit 0846560
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/common_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ function api_return_ok ( $message ) {

// Handle PHP error
set_error_handler("ganglia_api_error_handler");
function ganglia_api_error_handler ($no, $str, $file, $line, $context) {
$context; // PHPCS
function ganglia_api_error_handler ($no, $str, $file, $line) {
switch ($no) {
case E_ERROR:
case E_CORE_ERROR:
Expand Down

0 comments on commit 0846560

Please sign in to comment.