Completed
Push — master ( bb1b9f...121747 )
by Alexandr
05:24 queued 02:30
created

KpiStatusType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValues() 0 17 1
1
<?php
2
namespace Youshido\Tests\Issues\Issue171;
3
4
use Youshido\GraphQL\Config\Schema\SchemaConfig;
5
use Youshido\GraphQL\Schema\AbstractSchema;
6
use Youshido\GraphQL\Type\Enum\AbstractEnumType;
7
use Youshido\GraphQL\Type\Object\AbstractObjectType;
8
9
class Issue171Schema extends AbstractSchema
10
{
11
    public function build(SchemaConfig $config)
12
    {
13
        $config->getQuery()->addField(
14
            'plan',
15
            [
16
                'type' => new PlanType(),
17
            ]
18
        );
19
    }
20
}
21
22
class PlanType extends AbstractObjectType
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
23
{
24
    public function build($config)
25
    {
26
        $config->addField('kpi_status', [
27
            'type' => new KpiStatusType(),
28
        ]);
29
    }
30
}
31
32
class KpiStatusType extends AbstractEnumType
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
33
{
34
    public function getValues()
35
    {
36
        return [
37
            [
38
                'name'              => 'BAD',
39
                'value'             => 'Bad',
40
            ],
41
            [
42
                'name'              => 'GOOD',
43
                'value'             => 'Good',
44
            ],
45
            [
46
                'name'              => 'WARNING',
47
                'value'             => 'Warning',
48
            ]
49
        ];
50
    }
51
}