mirror of
https://github.com/symfony/framework-bundle.git
synced 2026-03-24 09:22:12 +01:00
32 lines
865 B
PHP
32 lines
865 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Symfony\Bundle\FrameworkBundle\ErrorHandler\ErrorRenderer;
|
|
|
|
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
|
|
|
|
/**
|
|
* @internal
|
|
*
|
|
* @author Yonel Ceruto <open@yceruto.dev>
|
|
*/
|
|
final class RuntimeModeErrorRendererSelector
|
|
{
|
|
/**
|
|
* @param \Closure(): ErrorRendererInterface $htmlErrorRenderer
|
|
* @param \Closure(): ErrorRendererInterface $cliErrorRenderer
|
|
*/
|
|
public static function select(bool $isWebMode, \Closure $htmlErrorRenderer, \Closure $cliErrorRenderer): ErrorRendererInterface
|
|
{
|
|
return ($isWebMode ? $htmlErrorRenderer : $cliErrorRenderer)();
|
|
}
|
|
}
|