FileTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
3
namespace Nord\Lumen\FileManager;
4
5
use League\Fractal\TransformerAbstract;
6
use Nord\Lumen\FileManager\Contracts\File as FileContract;
7
8
class FileTransformer extends TransformerAbstract
9
{
10
11
    /**
12
     * @param FileContract $file
13
     *
14
     * @return array
15
     */
16
    public function transform(FileContract $file)
17
    {
18
        return [
19
            'id'        => $file->getId(),
20
            'name'      => $file->getName(),
21
            'mime_type' => $file->getMimeType(),
22
            'byte_size' => $file->getByteSize(),
23
            'data'      => $file->getData(),
24
            'saved_at'  => $file->getSavedAt(),
25
        ];
26
    }
27
}
28