FileTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 11 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