AbstractResource   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
__invoke() 0 1 ?
1
<?php
2
3
/**
4
 * @author    Flipbox Factory
5
 * @copyright Copyright (c) 2017, Flipbox Digital
6
 * @link      https://github.com/flipbox/transform/releases/latest
7
 * @license   https://github.com/flipbox/transform/blob/master/LICENSE
8
 */
9
10
namespace Flipbox\Transform\Resources;
11
12
use Flipbox\Transform\Scope;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 3.0.0
17
 */
18
abstract class AbstractResource implements ResourceInterface
19
{
20
    /**
21
     * @var mixed
22
     */
23
    protected $data;
24
25
    /**
26
     * @var callable
27
     */
28
    protected $transformer;
29
30
    /**
31
     * ArrayItem constructor.
32
     * @param $data
33
     * @param callable $transformer
34
     */
35
    public function __construct($data, callable $transformer)
36
    {
37
        $this->data = $data;
38
        $this->transformer = $transformer;
39
    }
40
41
    /**
42
     * @inheritdoc
43
     */
44
    abstract public function __invoke(Scope $scope, string $identifier = null, ...$params);
45
}
46