ConstraintAttributeProcessor   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 process() 0 3 1
A type() 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\ElementBuilderInterface;
7
use Symfony\Component\Validator\Constraint;
8
9
/**
10
 * Add the constraint by calling satisfy
11
 *
12
 * @see ElementBuilderInterface::satisfy()
13
 * @see Constraint
14
 *
15
 * @implements ElementAttributeProcessorInterface<Constraint>
16
 */
17
final class ConstraintAttributeProcessor implements ElementAttributeProcessorInterface
18
{
19
    use SimpleMethodCallGeneratorTrait;
20
21
    /**
22
     * {@inheritdoc}
23
     */
24 50
    public function type(): string
25
    {
26 50
        return Constraint::class;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 3
    public function process(ChildBuilderInterface $builder, object $attribute): void
33
    {
34 3
        $builder->satisfy($attribute);
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 8
    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...
41
    {
42 8
        return 'satisfy';
43
    }
44
}
45