Completed
Pull Request — master (#732)
by 12345
03:41
created

FileBinary   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getContent() 0 4 1
A getPath() 0 4 1
A getMimeType() 0 4 1
A getFormat() 0 4 1
1
<?php
2
3
namespace Liip\ImagineBundle\Model;
4
5
use Liip\ImagineBundle\Binary\FileBinaryInterface;
6
7
class FileBinary implements FileBinaryInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $path;
13
14
    /**
15
     * @var string
16
     */
17
    protected $mimeType;
18
19
    /**
20
     * @var string
21
     */
22
    protected $format;
23
24
    /**
25
     * @param string $content
0 ignored issues
show
Bug introduced by
There is no parameter named $content. 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...
26
     * @param string $mimeType
27
     * @param string $format
28
     */
29
    public function __construct($path, $mimeType, $format = null)
30
    {
31
        $this->path = $path;
32
        $this->mimeType = $mimeType;
33
        $this->format = $format;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getContent()
40
    {
41
        return file_get_contents($this->path);
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getPath()
48
    {
49
        return $this->path;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getMimeType()
56
    {
57
        return $this->mimeType;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getFormat()
64
    {
65
        return $this->format;
66
    }
67
}
68