• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

fractalzombie / frzb-metrics-power / 9029631146

10 May 2024 08:38AM UTC coverage: 90.119% (-9.0%) from 99.111%
9029631146

push

github

fractalzombie
[MetricsPower] Added logstash processor

12 of 35 new or added lines in 4 files covered. (34.29%)

228 of 253 relevant lines covered (90.12%)

10.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/OptionsResolver/OptionsResolverLocator.php
1
<?php
2

3
/** @noinspection PhpIncompatibleReturnTypeInspection */
4

5
declare(strict_types=1);
6

7
/**
8
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
9
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11
 *
12
 * Copyright (c) 2024 Mykhailo Shtanko fractalzombie@gmail.com
13
 *
14
 * For the full copyright and license information, please view the LICENSE.MD
15
 * file that was distributed with this source code.
16
 */
17

18
namespace FRZB\Component\MetricsPower\OptionsResolver;
19

20
use FRZB\Component\DependencyInjection\Attribute\AsService;
21
use FRZB\Component\MetricsPower\Attribute\OptionsInterface;
22
use FRZB\Component\MetricsPower\OptionsResolver\Exception\OptionsResolverLocatorException;
23
use FRZB\Component\MetricsPower\OptionsResolver\Resolver\OptionsResolverInterface;
24
use Psr\Container\ContainerExceptionInterface;
25
use Psr\Container\ContainerInterface;
26
use Psr\Container\NotFoundExceptionInterface;
27
use Symfony\Component\DependencyInjection\Attribute\TaggedLocator;
28

29
#[AsService]
30
class OptionsResolverLocator implements OptionsResolverLocatorInterface
31
{
32
    public function __construct(
33
        #[TaggedLocator(OptionsResolverInterface::class, defaultIndexMethod: 'getType')]
34
        private readonly ContainerInterface $resolvers,
35
    ) {}
6✔
36

37
    public function get(OptionsInterface $option): ?OptionsResolverInterface
38
    {
39
        try {
40
            return $this->resolvers->get($option::class);
6✔
NEW
41
        } catch (NotFoundExceptionInterface) {
×
NEW
42
            return null;
×
NEW
43
        } catch (ContainerExceptionInterface $e) {
×
NEW
44
            throw OptionsResolverLocatorException::fromThrowable($e);
×
45
        }
46
    }
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc