Completed
Push — master ( 75a8b3...4406e7 )
by Alexandr
03:14
created

AbstractType   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 10
lcom 0
cbo 0
dl 0
loc 62
ccs 16
cts 20
cp 0.8
rs 10
c 0
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getNullableType() 0 4 1
A getNamedType() 0 4 1
A isCompositeType() 0 4 1
A getType() 0 4 1
A parseValue() 0 4 1
A isValidValue() 0 4 1
A parseInputValue() 0 4 1
A serialize() 0 4 1
A isInputType() 0 4 1
A __toString() 0 4 1
1
<?php
2
/*
3
* This file is a part of graphql-youshido project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 11/27/15 2:05 AM
7
*/
8
9
namespace Youshido\GraphQL\Type;
10
11
12
use Youshido\GraphQL\Type\Object\AbstractObjectType;
13
14
abstract class AbstractType implements TypeInterface
15
{
16
17 13
    public function isCompositeType()
18
    {
19 13
        return false;
20
    }
21
22
    /**
23
     * @return AbstractType
24
     */
25 21
    public function getType()
26
    {
27 21
        return $this;
28
    }
29
30
    /**
31
     * @return AbstractType
32
     */
33 18
    public function getNamedType()
34
    {
35 18
        return $this->getType();
36
    }
37
38
    /**
39
     * @return AbstractType|AbstractObjectType
40
     */
41 53
    public function getNullableType()
42
    {
43 53
        return $this;
44
    }
45
46 7
    public function isValidValue($value)
47
    {
48 7
        return true;
49
    }
50
51
    public function parseValue($value)
52
    {
53
        return $value;
54
    }
55
56
    public function parseInputValue($value)
57
    {
58
        return $this->parseValue($value);
59
    }
60
61 1
    public function serialize($value)
62
    {
63 1
        return $value;
64
    }
65
66 8
    public function isInputType()
67
    {
68 8
        return false;
69
    }
70
71 2
    public function __toString()
72
    {
73 2
        return $this->getName();
74
    }
75
}
76