Test Failed
Push — master ( 4bdf7b...97fe68 )
by Kirill
02:15
created

AnyType::isInputable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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\TypeInterface;
14
use Railt\Reflection\Document;
15
use Railt\Reflection\Type;
16
17
/**
18
 * Class AnyType
19
 */
20
final 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
     * @var int
34
     */
35
    private const DEFINITION_LINE = 0;
36
37
    /**
38
     * AnyScalar constructor.
39
     * @param Document $document
40
     */
41 9
    public function __construct(Document $document)
42
    {
43 9
        parent::__construct($document, self::TYPE_NAME);
44
45 9
        $this->withDescription(self::TYPE_DESCRIPTION);
46 9
        $this->withLine(self::DEFINITION_LINE);
47 9
    }
48
49
    /**
50
     * @return TypeInterface
51
     */
52 8
    public static function getType(): TypeInterface
53
    {
54 8
        return Type::of(Type::ANY);
55
    }
56
57
    /**
58
     * @return bool
59
     */
60
    public function isBuiltin(): bool
61
    {
62
        return true;
63
    }
64
}
65