InputFieldConfig   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 21
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultValue() 0 4 1
A getRules() 0 11 1
1
<?php
2
/*
3
* This file is a part of graphql-youshido project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 12/1/15 11:28 PM
7
*/
8
9
namespace Youshido\GraphQL\Config\Field;
10
11
12
use Youshido\GraphQL\Config\AbstractConfig;
13
use Youshido\GraphQL\Type\TypeService;
14
15
/**
16
 * Class InputFieldConfig
17
 * @package Youshido\GraphQL\Config\Field
18
 * @method $this setDescription(string $description)
19
 */
20
class InputFieldConfig extends AbstractConfig
21
{
22
23 2
    public function getRules()
24
    {
25
        return [
26 2
            'name'              => ['type' => TypeService::TYPE_STRING, 'final' => true],
27 2
            'type'              => ['type' => TypeService::TYPE_ANY_INPUT, 'final' => true],
28 2
            'defaultValue'      => ['type' => TypeService::TYPE_ANY],
29 2
            'description'       => ['type' => TypeService::TYPE_STRING],
30 2
            'isDeprecated'      => ['type' => TypeService::TYPE_BOOLEAN],
31 2
            'deprecationReason' => ['type' => TypeService::TYPE_STRING],
32 2
        ];
33
    }
34
35 10
    public function getDefaultValue()
36
    {
37 10
        return $this->get('defaultValue');
38
    }
39
40
}
41