Passed
Pull Request — master (#20)
by Christoffer
02:08
created

OfTypeTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setOfType() 0 5 1
A getOfType() 0 3 1
1
<?php
2
3
namespace Digia\GraphQL\Type\Definition;
4
5
trait OfTypeTrait
6
{
7
8
    /**
9
     * @var TypeInterface
10
     */
11
    private $ofType;
12
13
    /**
14
     * @return mixed
15
     */
16
    public function getOfType(): TypeInterface
17
    {
18
        return $this->ofType;
19
    }
20
21
    /**
22
     * @param TypeInterface $ofType
23
     * @return $this
24
     * @throws \TypeError
25
     */
26
    protected function setOfType(TypeInterface $ofType)
27
    {
28
        $this->ofType = $ofType;
29
30
        return $this;
31
    }
32
}
33