TransformerAbstract   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 14
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 6 1
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