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

SchemaObject   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 39
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A isBuiltin() 0 4 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 SchemaObject
17
 */
18
final class SchemaObject extends ObjectDefinition
19
{
20
    /**
21
     * @var string
22
     */
23
    public const TYPE_NAME = '__Schema';
24
25
    /**
26
     * @var string
27
     */
28
    public const TYPE_DESCRIPTION = 'A GraphQL Schema defines the capabilities of a GraphQL server.
29
It exposes all available types and directives on the server, as well
30
as the entry points for query, mutation, and subscription operations.';
31
32
    /**
33
     * @var int
34
     */
35
    public const TYPE_LINE = 7;
36
37
    /**
38
     * SchemaObject constructor.
39
     * @param Document $document
40
     */
41 9
    public function __construct(Document $document)
42
    {
43 9
        parent::__construct($document, static::TYPE_NAME);
44
45 9
        $this->withDescription(self::TYPE_DESCRIPTION);
46 9
        $this->withLine(self::TYPE_LINE);
47 9
    }
48
49
    /**
50
     * @return bool
51
     */
52
    public function isBuiltin(): bool
53
    {
54
        return true;
55
    }
56
}
57