for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Exceptions;
use Exception;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
HttpException::class,
];
* Report or log an exception.
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* @param \Exception $e
* @return void
public function report(Exception $e)
// sentry logging
if (app()->bound('sentry') && $this->shouldReport($e)) {
app('sentry')->captureException($e);
}
return parent::report($e);
parent::report($e)
Illuminate\Foundation\Exceptions\Handler::report()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
* Render an exception into an HTTP response.
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
public function render($request, Exception $e)
return parent::render($request, $e);
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.