Transformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
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 11
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A transformCollection() 0 6 1
transform() 0 1 ?
1
<?php
2
3
namespace App\Transformers;
4
5
/**
6
 * Created by PhpStorm.
7
 * User: pdavila
8
 * Date: 11/01/16
9
 * Time: 18:20
10
 */
11
abstract class Transformer {
12
13
    public function transformCollection(array $items)
14
    {
15
        return array_map([$this, 'transform'],
16
            $items->toArray()
0 ignored issues
show
Bug introduced by
The method toArray cannot be called on $items (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
17
        );
18
    }
19
20
    public abstract function transform($item);
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
21
}
22
23