InputFieldConfig::getDefaultValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
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: 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