for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace adamtester\laravelairbrake\Handler;
use Exception;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Contracts\Foundation\Application;
class AirbrakeExceptionHandler implements ExceptionHandler
{
/**
* @var
*/
private $handler;
* @var Application
private $app;
public function __construct(ExceptionHandler $handler, Application $app)
$this->handler = $handler;
$this->app = $app;
}
* Report or log an exception.
*
* @param \Exception $e
* @return void
public function report(Exception $e)
if (is_array(config('airbrake.ignore_environments')) && !in_array(app()->environment(), config('airbrake.ignore_environments')) && $this->handler->shouldReport($e)) {
shouldReport()
Illuminate\Contracts\Debug\ExceptionHandler
report()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
$this->app['Airbrake\Instance']->notify($e);
return $this->handler->report($e);
* Render an exception into an HTTP response.
* @param \Symfony\Component\Console\Output\OutputInterface $output
$output
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return \Symfony\Component\HttpFoundation\Response
public function render($request, Exception $e)
return $this->handler->render($request, $e);
* Render an exception to the console.
public function renderForConsole($output, Exception $e)
return $this->handler->renderForConsole($output, $e);
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.