for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Arp\LaminasMonolog\Factory\Handler;
use Arp\LaminasFactory\AbstractFactory;
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
use Monolog\Handler\NullHandler;
use Monolog\Logger;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
final class NullHandlerFactory extends AbstractFactory
{
/**
* @throws ServiceNotCreatedException
* @throws ContainerExceptionInterface
*/
public function __invoke(ContainerInterface $container, string $requestedName, array $options = null): NullHandler
$options = $options ?? $this->getServiceOptions($container, $requestedName);
$level = $options['level'] ?? Logger::DEBUG;
return new NullHandler($level);
}