Completed
Push — master ( b1b83d...ca1168 )
by ARCANEDEV
11s
created

TransformableModel::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php namespace Arcanedev\LaravelApiHelper\Traits;
2
3
use Illuminate\Support\Fluent;
4
5
/**
6
 * Class     TransformableModel
7
 *
8
 * @package  Arcanedev\LaravelApiHelper\Traits
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
trait TransformableModel
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
    /**
18
     * Transform the model.
19
     *
20
     * @param  callable  $callable
21
     *
22
     * @return \Illuminate\Support\Fluent
23
     */
24 6
    public function transform(callable $callable)
25
    {
26 6
        return new Fluent($callable($this));
27
    }
28
}
29