Test Failed
Push — master ( d820d2...d59132 )
by Kirill
02:27
created

DirectiveObject::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\Reflection\Introspection\Object;
11
12
use Railt\Reflection\Definition\ObjectDefinition;
13
use Railt\Reflection\Document;
14
15
/**
16
 * Class DirectiveObject
17
 */
18
final class DirectiveObject extends ObjectDefinition
19
{
20
    /**
21
     * @var string
22
     */
23
    public const TYPE_NAME = '__Directive';
24
25
    /**
26
     * @var string
27
     */
28
    public const TYPE_DESCRIPTION = 'A Directive provides a way to describe alternate runtime execution
29
and type validation behavior in a GraphQL document.
30
31
In some cases, you need to provide options to alter GraphQL\'s
32
execution behavior in ways field arguments will not suffice, such
33
as conditionally including or skipping a field. Directives provide
34
this by describing additional information to the executor.';
35
36
    /**
37
     * @var int
38
     */
39
    public const TYPE_LINE = 133;
40
41
    /**
42
     * SchemaObject constructor.
43
     * @param Document $document
44
     */
45 9
    public function __construct(Document $document)
46
    {
47 9
        parent::__construct($document, static::TYPE_NAME);
48
49 9
        $this->withDescription(self::TYPE_DESCRIPTION);
50 9
        $this->withLine(self::TYPE_LINE);
51 9
    }
52
53
    /**
54
     * @return bool
55
     */
56
    public function isBuiltin(): bool
57
    {
58
        return true;
59
    }
60
}
61