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

SymfonyPropertyAccessor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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