Test Failed
Push — master ( d820d2...d59132 )
by Kirill
02:27
created

AnyType   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 55
ccs 6
cts 12
cp 0.5
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getType() 0 4 1
A isRenderable() 0 4 1
A isInputable() 0 4 1
A isBuiltin() 0 4 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\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