Completed
Push — master ( 5ac91e...39483e )
by Kirill
38:30
created

AnyType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 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\SDL\Standard\Scalars;
11
12
use Railt\SDL\Base\Definitions\BaseScalar;
13
use Railt\SDL\Contracts\Document;
14
use Railt\SDL\Standard\StandardType;
15
16
/**
17
 * RFC325 Implementation.
18
 *
19
 * @see https://github.com/facebook/graphql/pull/325
20
 */
21
class AnyType extends BaseScalar implements StandardType
22
{
23
    /**
24
     * The Any scalar public name constant.
25
     * This name will be used in the future as the
26
     * type name available for use in our schema.
27
     */
28
    protected const SCALAR_TYPE_NAME = 'Any';
29
30
    /**
31
     * Short Any scalar public description.
32
     */
33
    protected const TYPE_DESCRIPTION = 'The `Any` scalar type represents any value that is supported by underlying
34
serialization protocol (including lists and maps). It is intended to be used
35
as an opt-out type in cases when the exact type is not known in advance.';
36
37
    /**
38
     * @param Document $document
39
     */
40 283
    public function __construct(Document $document)
41
    {
42 283
        $this->document    = $document;
43 283
        $this->name        = static::SCALAR_TYPE_NAME;
44 283
        $this->description = static::TYPE_DESCRIPTION;
45 283
    }
46
}
47