Inflection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getClass() 0 4 1
A canBeAppliedTo() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Phact\Container\Inflection;
4
5
use Phact\Container\Details\HasCallsTrait;
6
use Phact\Container\Details\HasPropertiesTrait;
7
8
class Inflection implements InflectionInterface
9
{
10
    use HasPropertiesTrait;
11
    use HasCallsTrait;
12
13
    /**
14
     * @var string
15
     */
16
    protected $class;
17
18 5
    public function __construct(string $class)
19
    {
20 5
        $this->class = $class;
21 5
    }
22
23
    /**
24
     * @return string
25
     */
26 1
    public function getClass(): string
27
    {
28 1
        return $this->class;
29
    }
30
31 2
    public function canBeAppliedTo(object $object): bool
32
    {
33 2
        return is_a($object, $this->class);
34
    }
35
}
36