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

fractalzombie / frzb-dependency-injection / 4355207088

pending completion
4355207088

push

github

Mykhailo Shtanko
[DependencyInjection] Added SonarCloud checks, refactor GitHub actions, refactor for using not only id as class

44 of 50 new or added lines in 9 files covered. (88.0%)

7 existing lines in 5 files now uncovered.

210 of 247 relevant lines covered (85.02%)

4.77 hits per line

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

85.71
/Compiler/RegisterAsTaggedAttributesPass.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This is package for Symfony framework.
7
 *
8
 * (c) Mykhailo Shtanko <fractalzombie@gmail.com>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13

14
namespace FRZB\Component\DependencyInjection\Compiler;
15

16
use FRZB\Component\DependencyInjection\Attribute\AsTagged;
17
use FRZB\Component\DependencyInjection\Helper\DefinitionHelper;
18
use FRZB\Component\DependencyInjection\Helper\EnvironmentHelper;
19
use FRZB\Component\DependencyInjection\Helper\TagHelper;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
use Symfony\Component\DependencyInjection\Definition;
22

23
/**
24
 * @internal
25
 *
26
 * Register #[AsTagged] attribute on definition that is autoconfigured
27
 *
28
 * @author Mykhailo Shtanko <fractalzombie@gmail.com>
29
 */
30
final class RegisterAsTaggedAttributesPass extends AbstractRegisterAttributePass
31
{
32
    public function __construct()
33
    {
34
        parent::__construct(AsTagged::class);
3✔
35
    }
36

37
    public function register(ContainerBuilder $container, \ReflectionClass $reflectionClass, AsTagged $attribute): void
38
    {
39
        if (!EnvironmentHelper::isPermittedEnvironment($container, $reflectionClass)) {
3✔
UNCOV
40
            return;
×
41
        }
42

43
        $container
3✔
44
            ->getDefinition(DefinitionHelper::getServiceId($container, $reflectionClass, $attribute->id))
3✔
45
            ->addTag($attribute->name, TagHelper::toTag($attribute))
3✔
46
        ;
3✔
47
    }
48
}
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

© 2025 Coveralls, Inc