protected function installWhoops()
    {
        // Configure the page handler of Whoops
        if (true === $this->isCli()) {
            // Text for cli
            $exceptionHandler = new PlainTextHandler();

        } else {
            // Otherwise the pretty one
            $exceptionHandler = new PrettyPageHandler();
            $constants        = get_defined_constants();

            $exceptionHandler->setPageTitle('Doozr');

            // Extract Doozr Constants as debugging information
            $data = [];
            foreach ($constants as $key => $value) {
                if ('DOOZR_' === substr($key, 0, 6)) {
                    $data[$key] = (true === is_bool($value)) ? ((true === $value) ? 'TRUE' : 'FALSE') : $value;
                }
            }
            ksort($data);

            $exceptionHandler->addDataTable('Doozr Environment', $data);
        }

        $this->getWhoops()->pushHandler($exceptionHandler);
        $this->getWhoops()->register();

        // Chaining
        return $this;
    }