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

TransformableModel   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 18
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 4 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