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

AbstractType   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 87.5%

Importance

Changes 9
Bugs 2 Features 1
Metric Value
wmc 8
c 9
b 2
f 1
lcom 0
cbo 0
dl 0
loc 52
ccs 14
cts 16
cp 0.875
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A isCompositeType() 0 4 1
A getNullableType() 0 4 1
A getType() 0 4 1
A getNamedType() 0 4 1
A isValidValue() 0 4 1
A parseValue() 0 4 1
A serialize() 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 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