Passed
Push — master ( e86c97...dfc587 )
by Christoffer
02:07
created

NonNullType::setOfType()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace Digia\GraphQL\Type\Definition;
4
5
class NonNullType implements TypeInterface, WrappingTypeInterface
6
{
7
    use NameTrait;
8
    use DescriptionTrait;
9
    use OfTypeTrait;
10
11
    /**
12
     * NonNullType constructor.
13
     *
14
     * @param TypeInterface $ofType
15
     */
16
    public function __construct(TypeInterface $ofType)
17
    {
18
        $this->ofType = $ofType;
19
    }
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function __toString(): string
25
    {
26
        return (string)$this->ofType . '!';
27
    }
28
}
29