Completed
Push — master ( 461e07...b4459a )
by Alexandr
03:37
created

AbstractScalarType   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 11
Bugs 0 Features 4
Metric Value
wmc 4
c 11
b 0
f 4
lcom 0
cbo 1
dl 0
loc 23
rs 10
ccs 5
cts 5
cp 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getKind() 0 4 1
A getName() 0 6 1
A getType() 0 4 1
A build() 0 1 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\Type\AbstractType;
12
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
13
use Youshido\GraphQL\Type\TypeMap;
14
15
abstract class AbstractScalarType extends AbstractType
16
{
17
18 12
    public function getName()
19
    {
20 12
        $className = get_class($this);
21
22 12
        return substr($className, strrpos($className, '\\') + 1, -4);
23
    }
24
25 20
    final public function getKind()
26
    {
27 20
        return TypeMap::KIND_SCALAR;
28
    }
29
30
    public function getType()
31
    {
32
        return $this;
33
    }
34
35
    public function build($config) {}
36
37
}
38