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

KpiStatusType::getValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 17
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
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
}