ImageTransformer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A transform() 0 6 1
A includeFile() 0 4 1
1
<?php
2
3
namespace Nord\Lumen\ImageManager;
4
5
use League\Fractal\TransformerAbstract;
6
use Nord\Lumen\FileManager\FileTransformer;
7
use Nord\Lumen\ImageManager\Contracts\Image as ImageContract;
8
9
class ImageTransformer extends TransformerAbstract
10
{
11
12
    /**
13
     * List of resources possible to include
14
     *
15
     * @var array
16
     */
17
    protected $availableIncludes = [
18
        'file',
19
    ];
20
21
22
    /**
23
     * @param string        $url
0 ignored issues
show
Bug introduced by
There is no parameter named $url. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
24
     * @param ImageContract $image
25
     *
26
     * @return array
27
     */
28
    public function transform(ImageContract $image)
29
    {
30
        return [
31
            'url' => $image->getUrl(),
32
        ];
33
    }
34
35
36
    /**
37
     * @param ImageContract $image
38
     *
39
     * @return \League\Fractal\Resource\Item
40
     */
41
    public function includeFile(ImageContract $image)
42
    {
43
        return $this->item($image->getFile(), new FileTransformer);
44
    }
45
}
46