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

AbstractType::parseInputValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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