TransformerAbstract::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: frowhy
5
 * Date: 2017/12/6
6
 * Time: 上午10:30.
7
 */
8
9
namespace Modules\Core\Abstracts;
10
11
use League\Fractal\TransformerAbstract as BaseTransformerAbstract;
12
13
abstract class TransformerAbstract extends BaseTransformerAbstract
14
{
15
    protected $transform;
16
    protected $field;
17
    protected $filter;
18
19
    abstract public function fields($attribute);
20
21
    public function transform($transform)
22
    {
23
        $this->transform = $transform;
24
        $this->field = $this->fields($transform);
25
26
        return $this->field;
27
    }
28
}
29