FormTypeReader   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPriority() 0 3 1
A read() 0 8 2
1
<?php
2
3
namespace JBen87\ParsleyBundle\Constraint\Reader;
4
5
use Symfony\Component\Form\FormInterface;
6
7
class FormTypeReader implements ReaderInterface
8
{
9
    /**
10
     * @inheritdoc
11
     */
12 2
    public function read(FormInterface $form): array
13
    {
14 2
        $config = $form->getConfig();
15 2
        if (false === $config->hasOption('constraints')) {
16 1
            return [];
17
        }
18
19 1
        return $config->getOption('constraints');
20
    }
21
22
    /**
23
     * @inheritdoc
24
     *
25
     * @codeCoverageIgnore
26
     */
27
    public function getPriority(): int
28
    {
29
        return 0;
30
    }
31
}
32