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

InterfaceDefinition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 21
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 4 1
A instanceOf() 0 4 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\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