Completed
Branch dev (20d83f)
by Arina
01:20
created

EloquentTransformer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

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