/** * @param ContainerInterface $container */ protected function register(ContainerInterface $container) { $core = $container->make('Kraken\\Core\\CoreInterface'); $context = $container->make('Kraken\\Runtime\\RuntimeContextInterface'); $env = new Environment($context, $core->getDataPath() . '/environment/.env'); $env->setOption('error_reporting', E_ALL); $env->setOption('log_errors', '1'); $env->setOption('display_errors', '0'); $env->registerErrorHandler(['Kraken\\Throwable\\ErrorHandler', 'handleError']); $env->registerShutdownHandler(function () use($context) { ErrorHandler::handleShutdown($context->getType() === Runtime::UNIT_PROCESS); }); $env->registerExceptionHandler(['Kraken\\Throwable\\ExceptionHandler', 'handleException']); $container->instance('Kraken\\Environment\\EnvironmentInterface', $env); }
/** * @dataProvider undefinedProvider */ public function testStaticApiHandleError_ReturnsImmediately_OnUndefinedLevelErrors($code, $expected) { ErrorHandler::handleError($code, $message = 'message', $file = 'file', $line = 20); }