Transformer::transform()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 1
nc 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