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

AnyType::getType()   A

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
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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;
11
12
use Railt\Reflection\AbstractTypeDefinition;
13
use Railt\Reflection\Contracts\Type as TypeInterface;
14
use Railt\Reflection\Document;
15
use Railt\Reflection\Type;
16
17
/**
18
 * Class AnyType
19
 */
20
class AnyType extends AbstractTypeDefinition
21
{
22
    /**
23
     * @var string
24
     */
25
    public const TYPE_NAME = 'Any';
26
27
    /**
28
     * @var string
29
     */
30
    public const TYPE_DESCRIPTION = 'Abstract type, representing any data type';
31
32
    /**
33
     * AnyScalar constructor.
34
     * @param Document $document
35
     */
36 9
    public function __construct(Document $document)
37
    {
38 9
        parent::__construct($document, self::TYPE_NAME);
39
40 9
        $this->withDescription(self::TYPE_DESCRIPTION);
41 9
    }
42
43
    /**
44
     * @return TypeInterface
45
     */
46 6
    public static function getType(): TypeInterface
47
    {
48 6
        return Type::of(Type::ANY);
49
    }
50
}
51