Transformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A transformCollection() 0 4 1
transform() 0 1 ?
1
<?php
2
3
namespace App\Http\Transformers;
4
5
/**
6
 * Class Transformer
7
 * @package App\Http\Transformers
8
 */
9
abstract class Transformer
10
{
11
    /**
12
     * @param array $items
13
     * @return array
14
     */
15
    public function transformCollection(array $items)
16
    {
17
        return array_map([$this, 'transform'], $items);
18
    }
19
20
    /**
21
     * @param $item
22
     * @return mixed
23
     */
24
    abstract public function transform($item);
25
}