Completed
Push — develop ( 523088...d9cee5 )
by Baptiste
01:42
created

Instance   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A accepts() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Compose\Definition\Argument\Type;
5
6
use Innmind\Compose\Definition\Argument\Type;
7
8
final class Instance implements Type
9
{
10
    private $class;
11
12 3
    public function __construct(string $class)
13
    {
14 3
        $this->class = $class;
15 3
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 2
    public function accepts($value): bool
21
    {
22 2
        return $value instanceof $this->class;
23
    }
24
}
25