ClassDefinition   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getField() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPTdGram\SchemaGenerator\Model;
6
7
/**
8
 * @author  Aurimas Niekis <[email protected]>
9
 */
10
class ClassDefinition
11
{
12
    public string $parentClass;
13
    public string $className;
14
    public string $classDocs;
15
16
    /** @var FieldDefinition[] */
17
    public array  $fields = [];
18
    public string $returnType;
19
    public string $typeName;
20
21
    public function getField(string $name): FieldDefinition
22
    {
23
        if (false === isset($this->fields[$name])) {
24
            $this->fields[$name] = new FieldDefinition();
25
        }
26
27
        return $this->fields[$name];
28
    }
29
}
30