Code Duplication    Length = 14-14 lines in 2 locations

src/Field/AbstractInputField.php 1 location

@@ 25-38 (lines=14) @@
22
23
    protected $isFinal = false;
24
25
    public function __construct(array $config = [])
26
    {
27
        if (empty($config['type'])) {
28
            $config['type'] = $this->getType();
29
            $config['name'] = $this->getName();
30
        }
31
32
        if (TypeService::isScalarType($config['type'])) {
33
            $config['type'] = TypeFactory::getScalarType($config['type']);
34
        }
35
36
        $this->config = new InputFieldConfig($config, $this, $this->isFinal);
37
        $this->build($this->config);
38
    }
39
40
    public function build(InputFieldConfig $config)
41
    {

src/Field/AbstractField.php 1 location

@@ 28-41 (lines=14) @@
25
26
    private $resolveCache = null;
27
28
    public function __construct(array $config = [])
29
    {
30
        if (empty($config['type'])) {
31
            $config['type'] = $this->getType();
32
            $config['name'] = $this->getName();
33
        }
34
35
        if (TypeService::isScalarType($config['type'])) {
36
            $config['type'] = TypeFactory::getScalarType($config['type']);
37
        }
38
39
        $this->config = new FieldConfig($config, $this, $this->isFinal);
40
        $this->build($this->config);
41
    }
42
43
    /**
44
     * @return AbstractObjectType