Completed
Push — master ( 5fafaa...45c2d8 )
by Arina
13s queued 11s
created

EloquentTransformer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 4 1
A transform() 0 4 1
1
<?php
2
3
namespace ArinaSystems\JsonResponse\Data\Transformers;
4
5
use ArinaSystems\JsonResponse\Data\Transformers\Transformer;
6
7
class EloquentTransformer extends Transformer
8
{
9
    /**
10
     * Transform the data value to array.
11
     *
12
     * @return array
13
     */
14
    public function toArray(): array
15
    {
16
        return $this->item->toArray();
17
    }
18
19
    public function transform(): string
20
    {
21
        return \Illuminate\Database\Eloquent\Model::class;
22
    }
23
}
24