exceptionHandler($exception); } /** * @param Throwable $e */ public function exceptionHandler($e) { $this->handle( $e->getCode(), get_class($e) . ': ' . $e->getMessage(), $e->getFile(), $e->getLine(), ['exception' => $e] ); } /** * @param int $number * @param string $string * @param string $file * @param int $line * @param array $context * @param array $trace */ protected function handle($number, $string, $file, $line, $context = [], $trace = []) { error_log(sprintf('Exception: Number: %s, String: %s, File: %s:%u, Context: %s', $number, $string, $file, $line, json_encode($context) )); $file = $this->stripBasePath($file); if ($this->environment == self::ENV_DEVELOPMENT) { echo '
';
echo sprintf('%s: (%s)' . PHP_EOL, ucfirst($type), $number);
var_export([
'string' => $string,
'file' => $file . ':' . $line,
'context' => $context,
'stacktrace' => $this->formatStackTrace($trace),
]);
echo '';
die();
}
echo 'An