Issues (12)

src/Business/Handler/HandlerResolver.php (1 issue)

Labels
Severity
1
<?php
2
3
/*
4
 *  This file is part of the Micro framework package.
5
 *
6
 *  (c) Stanislau Komar <[email protected]>
7
 *
8
 *  For the full copyright and license information, please view the LICENSE
9
 *  file that was distributed with this source code.
10
 */
11
12
namespace Micro\Plugin\Logger\Monolog\Business\Handler;
13
14
use Micro\Plugin\Logger\Configuration\LoggerProviderTypeConfigurationInterface;
15
use Micro\Plugin\Logger\Monolog\Configuration\Logger\MonologPluginConfigurationInterface;
16
17
readonly class HandlerResolver implements HandlerResolverInterface
0 ignored issues
show
A parse error occurred: Syntax error, unexpected T_READONLY on line 17 at column 0
Loading history...
18
{
19 2
    public function __construct(
20
        private MonologPluginConfigurationInterface $pluginConfiguration,
21
        private HandlerProviderInterface $handlerProvider,
22
        private LoggerProviderTypeConfigurationInterface $loggerProviderTypeConfiguration
23
    ) {
24 2
    }
25
26 1
    public function resolve(): \Traversable
27
    {
28 1
        $loggerConfiguration = $this->pluginConfiguration
29 1
            ->getLoggerConfiguration($this->loggerProviderTypeConfiguration->getLoggerName());
30
31 1
        foreach ($loggerConfiguration->getHandlerList() as $handlerName) {
32 1
            yield $this->handlerProvider->getHandler($this->loggerProviderTypeConfiguration, $handlerName);
33
        }
34
    }
35
}
36