Completed
Branch develop (c4bcdd)
by Stephen
06:03
created

Transformable::newCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Spinen\Transformers;
4
5
/**
6
 * Class Transformable
7
 *
8
 * @package App\Support\Transformation
9
 */
10
trait Transformable
11
{
12
    /**
13
     * Tell eloquent to make the collection as a TransformableCollection
14
     *
15
     * This allows us to mix in methods to the collection.
16
     *
17
     * @param array $models
18
     *
19
     * @return TransformableCollection
20
     */
21
    public function newCollection(array $models = [])
22
    {
23
        return new TransformableCollection($models);
24
    }
25
}
26