First off I must say that the indentation is quite inconsistent and makes reading this code challenging. While most of the inconsistencies appear to be indentation on braces, the indentation on comments also seems a bit wonky. While I don't adhere to everything in it, I suggest following PSR-2 - especially using 4 spaces for indentation.
One thing I observed in the sample usage code is that $file
and $line
are NULL
. Perhaps you were intending to use those from the array $error
. I also noticed captureNormal()
hasstores an array in the variable $error
but that doesn't appear to be used after it is declared (despite the comment on the next line: Display content $error variable
). Maybe you took the usage of $error
out of that static method and moved it into the other file?
public static function captureNormal( $number, $message,
$file, $line )
{
// Insert all in one table
$error = array( 'type' => $number,
'message' => $message,
'file' => $file,
'line' => $line
);
// Display content $error variable
self::addError('error', $message . " at " . $file .
':' . $line);
}
To avoid the need to escape double quotes in the HTML, you could use a different delimiting method like heredoc or nowdoc. And perhaps it would be simpler to move the styles into CSS.