Completed
Pull Request — master (#33)
by Daniel
15:07 queued 09:14
created

TextField   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getViewType() 0 4 1
A getFormType() 0 4 1
A getStorageType() 0 4 1
A configureOptions() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\ContentType\Standard\Field;
6
7
use Psi\Component\ContentType\FieldInterface;
8
use Psi\Component\ContentType\OptionsResolver\FieldOptionsResolver;
9
use Psi\Component\ContentType\Standard\View\ScalarView;
10
use Psi\Component\ContentType\Storage\ConfiguredType;
11
use Psi\Component\ContentType\Storage\TypeFactory;
12
use Symfony\Component\Form\Extension\Core\Type\TextType;
13
14
class TextField implements FieldInterface
15
{
16
    public function getViewType(): string
17
    {
18
        return ScalarView::class;
19
    }
20
21
    public function getFormType(): string
22
    {
23
        return TextType::class;
24
    }
25
26
    public function getStorageType(TypeFactory $factory): ConfiguredType
27
    {
28
        return $factory->create('string');
29
    }
30
31
    public function configureOptions(FieldOptionsResolver $options)
32
    {
33
    }
34
}
35