for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Equip\Configuration;
use Auryn\Injector;
use Whoops\Handler\JsonResponseHandler;
use Whoops\Handler\PlainTextHandler;
use Whoops\Run as Whoops;
class WhoopsConfiguration implements ConfigurationInterface
{
use EnvTrait;
/**
* @inheritDoc
*/
public function apply(Injector $injector)
$injector->prepare(Whoops::class, [$this, 'prepareWhoops']);
$injector->prepare(JsonResponseHandler::class, [$this, 'prepareJsonHandler']);
$injector->prepare(PlainTextHandler::class, [$this, 'preparePlainTextHandler']);
}
* @param Whoops $whoops
*
* @return void
public function prepareWhoops(Whoops $whoops)
if($this->env->getValue('DEBUG_STACKTRACE', false) == true) {
set_error_handler([$whoops, Whoops::ERROR_HANDLER]);
$whoops->writeToOutput(false);
$whoops->allowQuit(false);
* @param JsonResponseHandler $handler
public function prepareJsonHandler(JsonResponseHandler $handler)
$handler->addTraceToOutput(true);
* @param PlainTextHandler $handler
public function preparePlainTextHandler(PlainTextHandler $handler)