Test Failed
Push — master ( 86235b...91db11 )
by Kirill
02:29
created

ObjectDefinition::isInputable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
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\Definition;
11
12
use Railt\Reflection\Contracts\Definition\ObjectDefinition as ObjectDefinitionInterface;
13
use Railt\Reflection\Contracts\Definition\TypeDefinition;
14
use Railt\Reflection\Contracts\TypeInterface;
15
use Railt\Reflection\Definition\Behaviour\HasFields;
16
use Railt\Reflection\Definition\Behaviour\HasInterfaces;
17
use Railt\Reflection\Type;
18
use Railt\Reflection\AbstractTypeDefinition;
19
20
/**
21
 * Class ObjectDefinition
22
 */
23 View Code Duplication
class ObjectDefinition extends AbstractTypeDefinition implements ObjectDefinitionInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
{
25
    use HasInterfaces;
26
    use HasFields;
27
28
    /**
29
     * @return TypeInterface
30
     */
31
    public static function getType(): TypeInterface
32
    {
33
        return Type::of(Type::INTERFACE);
34
    }
35
36
    /**
37
     * @param TypeDefinition $definition
38
     * @return bool
39
     */
40 1
    public function instanceOf($definition): bool
41
    {
42
        // Return a positive response if the parent type (like Object or Interface)
43
        // can implement the desired type.
44 1
        return $this->isImplements($definition) ||
45 1
            parent::instanceOf($definition);
46
    }
47
48
    /**
49
     * @return bool
50
     */
51
    public function isRenderable(): bool
52
    {
53
        return true;
54
    }
55
56
    /**
57
     * @return bool
58
     */
59
    public function isInputable(): bool
60
    {
61
        return false;
62
    }
63
}
64