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

EloquentTransformer::objectClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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