Completed
Push — master ( 96b2f8...da2c9c )
by Kirill
05:58
created

InterfaceDefinition::instanceOf()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
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\AbstractTypeDefinition;
13
use Railt\Reflection\Contracts\Definition\TypeDefinition;
14
use Railt\Reflection\Contracts\Type as TypeInterface;
15
use Railt\Reflection\Definition\Behaviour\HasInterfaces;
16
use Railt\Reflection\Type;
17
use Railt\Reflection\Contracts\Definition\ObjectDefinition as ObjectDefinitionInterface;
18
19
/**
20
 * Class InterfaceDefinition
21
 */
22
class InterfaceDefinition extends AbstractTypeDefinition implements ObjectDefinitionInterface
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: getFieldDefinition, getFieldDefinitions, hasFieldDefinition
Loading history...
23
{
24
    use HasInterfaces;
25
26
    /**
27
     * @return TypeInterface
28
     */
29
    public static function getType(): TypeInterface
30
    {
31
        return Type::of(Type::INTERFACE);
32
    }
33
34
    /**
35
     * @param TypeDefinition $definition
36
     * @return bool
37
     */
38
    public function instanceOf(TypeDefinition $definition): bool
39
    {
40
        return $this->instanceOfInterface($definition) || parent::instanceOf($definition);
41
    }
42
}
43