Method handleError
has 5 arguments (exceeds 4 allowed). Consider refactoring.
public function handleError($level, $message, $file = '', $line = 0, $context = [])
Function handleShutdown
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
public function handleShutdown()
{
if ($e = error_get_last()) {
if ($this->isFatal($e['type'])) {
$this->record($e);
Function handleError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
public function handleError($level, $message, $file = '', $line = 0, $context = [])
{
if (error_reporting() & $level) {
$error = [
'message' => $message,
Avoid using undefined variables such as '$e' which will lead to PHP notices.
$this->renderHttpResponse($e);
Avoid using undefined variables such as '$error' which will lead to PHP notices.
$error['message'] = $e;
Avoid using undefined variables such as '$e' which will lead to PHP notices.
$this->renderForConsole($e);
Avoid using undefined variables such as '$error' which will lead to PHP notices.
$e = $error;
Avoid using undefined variables such as '$error' which will lead to PHP notices.
$error['file'] = $trace[0]['file'];
Avoid using undefined variables such as '$error' which will lead to PHP notices.
$error['line'] = $trace[0]['line'];
Missing class import via use statement (line '128', column '31').
$controller = new \Controller($this->app);
The method renderHttpResponse uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
}else {
if (!is_array($e)) {
$trace = debug_backtrace();
$error['message'] = $e;
$error['file'] = $trace[0]['file'];
The method handleShutdown uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$this->renderHttpResponse($e);
}
The method handleError uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$this->renderHttpResponse($e);
}
The method handleException uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$this->renderHttpResponse($error);
}
Avoid assigning values to variables in if clauses and the like (line '153', column '13').
public function handleShutdown()
{
if ($e = error_get_last()) {
if ($this->isFatal($e['type'])) {
$this->record($e);
Avoid unused parameters such as '$e'.
protected function renderForConsole($e)
Avoid unused parameters such as '$context'.
public function handleError($level, $message, $file = '', $line = 0, $context = [])
Avoid variables with short names like $e. Configured minimum length is 3.
public function handleException($e)
Avoid variables with short names like $e. Configured minimum length is 3.
protected function renderHttpResponse($e)
Avoid variables with short names like $e. Configured minimum length is 3.
if ($e = error_get_last()) {
Avoid variables with short names like $e. Configured minimum length is 3.
protected function renderForConsole($e)
Avoid variables with short names like $e. Configured minimum length is 3.
protected function record($e, $type = 'error')
The closing brace for the class must go on the next line after the body
}
Function closing brace must go on the next line following the body; found 1 blank lines before brace
}
Blank line found at end of control structure
Line exceeds 120 characters; contains 126 characters
\Log::$type('[' . $this->levels[$e['type']] . '] ' . $e['message'] . '[' . $e['file'] . ' : ' . $e['line'] . ']', []);
Expected 1 space after closing brace; 0 found
}else {
There are no issues that match your filters.