InventoryTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 9
rs 9.6666
ccs 0
cts 9
cp 0
cc 1
eloc 5
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Scool\Inventory\Transformers;
4
5
use League\Fractal\TransformerAbstract;
6
7
/**
8
 * Class InventoryTransformer.
9
 */
10
class InventoryTransformer extends TransformerAbstract
11
{
12
    /**
13
     * Transform the \Inventory entity.
14
     *
15
     * @param \Inventory $model
16
     *
17
     * @return array
18
     */
19
    public function transform(Inventory $model)
20
    {
21
        return [
22
            'id'         => (int) $model->id,
23
            /* place your other model properties here */
24
            'created_at' => $model->created_at,
25
            'updated_at' => $model->updated_at,
26
        ];
27
    }
28
}
29