Completed
Push — master ( f73088...560fa4 )
by Alexandr
03:33
created

AbstractType::isValidValue()   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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
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 14
    public function isCompositeType()
18
    {
19 14
        return false;
20
    }
21
22
    /**
23
     * @return AbstractType
24
     */
25 48
    public function getType()
26
    {
27 48
        return $this;
28
    }
29
30
    /**
31
     * @return AbstractType
32
     */
33 45
    public function getNamedType()
34
    {
35 45
        return $this->getType();
36
    }
37
38
    /**
39
     * @return AbstractType|AbstractObjectType
40
     */
41 39
    public function getNullableType()
42
    {
43 39
        return $this;
44
    }
45
46
    public function isValidValue($value)
47
    {
48
        return true;
49
    }
50
51 3
    public function parseValue($value)
52
    {
53 3
        return $value;
54
    }
55
56 1
    public function serialize($value)
57
    {
58 1
        return $value;
59
    }
60
61 1
    public function __toString()
62
    {
63 1
        return $this->getName();
64
    }
65
}
66