Test Failed
Push — master ( d820d2...d59132 )
by Kirill
02:27
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
     * 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 8
    public static function getType(): TypeInterface
47
    {
48 8
        return Type::of(Type::ANY);
49
    }
50
51
    /**
52
     * @return bool
53
     */
54
    public function isRenderable(): bool
55
    {
56
        return true;
57
    }
58
59
    /**
60
     * @return bool
61
     */
62
    public function isInputable(): bool
63
    {
64
        return true;
65
    }
66
67
    /**
68
     * @return bool
69
     */
70
    public function isBuiltin(): bool
71
    {
72
        return true;
73
    }
74
}
75