Passed
Push — master ( 39e4c0...d4ca25 )
by Michael
03:36
created

SymfonyPropertyAccessor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValue() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Mikemirten\Component\JsonApi\Mapper\Handler\PropertyAccessor;
5
6
use Symfony\Component\PropertyAccess\PropertyAccessorInterface as SymfonyPropertyAccessorInterface;
7
8
/**
9
 * Symfony component based property accessor
10
 *
11
 * @package Mikemirten\Component\JsonApi\Mapper\Handler\PropertyAccessor
12
 */
13
class SymfonyPropertyAccessor implements PropertyAccessorInterface
14
{
15
    protected $accessor;
16
17
    /**
18
     * SymfonyPropertyAccessor constructor.
19
     *
20
     * @param SymfonyPropertyAccessorInterface $accessor
21
     */
22 1
    public function __construct(SymfonyPropertyAccessorInterface $accessor)
23
    {
24 1
        $this->accessor = $accessor;
25 1
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 1
    public function getValue($resource, string $path)
31
    {
32 1
        return $this->accessor->getValue($resource, $path);
33
    }
34
}