Inflection::getClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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