Completed
Push — master ( 46306f...e069d8 )
by Alexandr
03:27
created

AbstractScalarType::isInputType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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 1:00 AM
7
*/
8
9
namespace Youshido\GraphQL\Type\Scalar;
10
11
use Youshido\GraphQL\Config\Traits\ConfigAwareTrait;
12
use Youshido\GraphQL\Type\AbstractType;
13
use Youshido\GraphQL\Type\TypeMap;
14
15
abstract class AbstractScalarType extends AbstractType
16
{
17
    use ConfigAwareTrait;
18
19 10
    public function getName()
20
    {
21 10
        $className = get_class($this);
22
23 10
        return substr($className, strrpos($className, '\\') + 1, -4);
24
    }
25
26 22
    final public function getKind()
27
    {
28 22
        return TypeMap::KIND_SCALAR;
29
    }
30
31 10
    public function parseValue($value)
32
    {
33 10
        return $this->serialize($value);
34
    }
35
36 2
    public function isInputType()
37
    {
38 2
        return true;
39
    }
40
41
42
}
43