AbstractType   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 87
c 0
b 0
f 0
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A setName() 0 6 1
A getDescription() 0 4 1
A setDescription() 0 6 1
A getInternalType() 0 4 1
A setInternalType() 0 6 1
A toMapping() 0 7 1
1
<?php
2
3
namespace Arthem\GraphQLMapper\Mapping;
4
5
abstract class AbstractType
6
{
7
    /**
8
     * @var string
9
     */
10
    private $name;
11
12
    /**
13
     * @var string
14
     */
15
    private $description;
16
17
    /**
18
     * The GraphQL class used to build the final schema
19
     *
20
     * @var string
21
     */
22
    private $internalType = 'ObjectType';
23
24
    /**
25
     * @return string
26
     */
27
    public function getName()
28
    {
29
        return $this->name;
30
    }
31
32
    /**
33
     * @param string $name
34
     * @return $this
35
     */
36
    public function setName($name)
37
    {
38
        $this->name = $name;
39
40
        return $this;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getDescription()
47
    {
48
        return $this->description;
49
    }
50
51
    /**
52
     * @param string $description
53
     * @return $this
54
     */
55
    public function setDescription($description)
56
    {
57
        $this->description = $description;
58
59
        return $this;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getInternalType()
66
    {
67
        return $this->internalType;
68
    }
69
70
    /**
71
     * @param string $internalType
72
     * @return $this
73
     */
74
    public function setInternalType($internalType)
75
    {
76
        $this->internalType = $internalType;
77
78
        return $this;
79
    }
80
81
    /**
82
     * @return array<string,mixed>
83
     */
84
    public function toMapping()
85
    {
86
        return [
87
            'name'        => $this->name,
88
            'description' => $this->description,
89
        ];
90
    }
91
}
92