Test Failed
Push — master ( 3b7232...dbe410 )
by Kirill
02:20
created

IdScalar::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
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\Stdlib\Scalar;
11
12
use Railt\Reflection\Definition\ScalarDefinition;
13
use Railt\Reflection\Document;
14
15
/**
16
 * Class IdScalar
17
 */
18
class IdScalar extends ScalarDefinition
19
{
20
    /**
21
     * @var string
22
     */
23
    public const TYPE_NAME = 'ID';
24
25
    /**
26
     * @var string
27
     */
28
    public const TYPE_DESCRIPTION = <<<Description
29
The ID scalar type represents a unique identifier, often used to refetch 
30
an object or as the key for a cache. The ID type is serialized in the 
31
same way as a String; however, defining it as an ID signifies that it 
32
is not intended to be human‐readable.
33
Description;
34
35
    /**
36
     * BooleanScalar constructor.
37
     * @param Document $document
38
     */
39 9
    public function __construct(Document $document)
40
    {
41 9
        parent::__construct($document, self::TYPE_NAME);
42
43 9
        $this->withDescription(self::TYPE_DESCRIPTION);
44 9
    }
45
46
    /**
47
     * @return int
48
     */
49
    public function getLine(): int
50
    {
51
        return 25;
52
    }
53
}
54