HydratorAttributeProcessor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 26
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A type() 0 3 1
A process() 0 3 1
A methodName() 0 3 1
1
<?php
2
3
namespace Bdf\Form\Attribute\Processor\Element;
4
5
use Bdf\Form\Child\ChildBuilderInterface;
6
use Bdf\Form\PropertyAccess\HydratorInterface;
7
8
/**
9
 * Define as hydrator by calling hydrator()
10
 *
11
 * @see ChildBuilderInterface::hydrator()
12
 * @see HydratorInterface
13
 *
14
 * @implements ElementAttributeProcessorInterface<HydratorInterface>
15
 */
16
final class HydratorAttributeProcessor implements ElementAttributeProcessorInterface
17
{
18
    use SimpleMethodCallGeneratorTrait;
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 50
    public function type(): string
24
    {
25 50
        return HydratorInterface::class;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 18
    public function process(ChildBuilderInterface $builder, object $attribute): void
32
    {
33 18
        $builder->hydrator($attribute);
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39 16
    private function methodName(): string
0 ignored issues
show
Unused Code introduced by
The method methodName() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
40
    {
41 16
        return 'hydrator';
42
    }
43
}
44