Code Duplication    Length = 13-15 lines in 2 locations

src/Attributes/AttributesFactory.php 1 location

@@ 16-30 (lines=15) @@
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public static function build(
17
        array $attributes = [],
18
        AttributeFactoryInterface $attributeFactory = null
19
    ) {
20
        if (null === $attributeFactory) {
21
            $reflection = new \ReflectionClass(AttributeFactory::class);
22
            /** @var \drupol\htmltag\Attribute\AttributeFactoryInterface $attributeFactory */
23
            $attributeFactory = $reflection->newInstance();
24
        }
25
26
        return new Attributes(
27
            $attributeFactory,
28
            $attributes
29
        );
30
    }
31
}
32

src/HtmlTag.php 1 location

@@ 48-60 (lines=13) @@
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function attributes(array $attributes = [], AttributeFactoryInterface $attributeFactory = null)
49
    {
50
        if (null === $attributeFactory) {
51
            /** @var \drupol\htmltag\Attribute\AttributeFactoryInterface $attributeFactory */
52
            $attributeFactory = (new \ReflectionClass(AttributeFactory::class))
53
                ->newInstance();
54
        }
55
56
        return new Attributes(
57
            $attributeFactory,
58
            $attributes
59
        );
60
    }
61
62
    /**
63
     * {@inheritdoc}