TestImage   A
last analyzed

Complexity

Total Complexity 19

Size/Duplication

Total Lines 133
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 19
lcom 0
cbo 0
dl 0
loc 133
rs 10
c 0
b 0
f 0

19 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getPath() 0 4 1
A setPath() 0 4 1
A getTitle() 0 4 1
A setTitle() 0 4 1
A getStyleData() 0 4 1
A setStyle() 0 4 1
A getAlt() 0 4 1
A setAlt() 0 4 1
A getWidth() 0 4 1
A setWidth() 0 4 1
A getHeight() 0 4 1
A setHeight() 0 4 1
A getCropCoordinates() 0 4 1
A setCropCoordinates() 0 4 1
A setFile() 0 4 1
A getFile() 0 4 1
A setSrc() 0 4 1
A getSrc() 0 4 1
1
<?php
2
3
namespace IrishDan\ResponsiveImageBundle\Tests\Entity;
4
5
use IrishDan\ResponsiveImageBundle\ResponsiveImageInterface;
6
use Symfony\Component\HttpFoundation\File\UploadedFile;
7
use Doctrine\ORM\Mapping as ORM;
8
use Symfony\Component\Validator\Constraints as Assert;
9
10
/**
11
 * @ORM\Entity(repositoryClass="IrishDan\ResponsiveImageBundle\Repository\ImageRepository")
12
 * @ORM\Table(name="image")
13
 * @ORM\HasLifecycleCallbacks()
14
 */
15
class TestImage implements ResponsiveImageInterface
16
{
17
    /**
18
     * @ORM\Column(name="id", type="integer")
19
     * @ORM\Id
20
     * @ORM\GeneratedValue(strategy="AUTO")
21
     */
22
    private $id = 1;
23
    /**
24
     * @ORM\Column(name="title", type="string", length=255)
25
     */
26
    private $title = 'Test image';
27
    /**
28
     * @ORM\Column(name="path", type="string", length=255, unique=true)
29
     */
30
    private $path = 'dummy.jpg';
31
    /**
32
     * @ORM\Column(name="alt", type="string", length=255, nullable=true)
33
     */
34
    private $alt = 'Test image alt text';
35
    /**
36
     * @ORM\Column(name="width", type="integer", nullable=true)
37
     */
38
    private $width = 1000;
39
    /**
40
     * @ORM\Column(name="height", type="integer", nullable=true)
41
     */
42
    private $height = 1600;
43
    /**
44
     * @Assert\File(maxSize="6000000")
45
     */
46
    private $file;
47
    /**
48
     * @ORM\Column(name="crop_coordinations", type="string", nullable=true)
49
     */
50
    private $cropCoordinates = '200, 3, 800, 1400:310, 145, 750, 617';
51
    private $src;
52
53
    public function getId()
54
    {
55
        return $this->id;
56
    }
57
58
    public function getPath()
59
    {
60
        return $this->path;
61
    }
62
63
    public function setPath($path)
64
    {
65
        $this->path = $path;
66
    }
67
68
    public function getTitle()
69
    {
70
        return $this->title;
71
    }
72
73
    public function setTitle($title)
74
    {
75
        $this->title = $title;
76
    }
77
78
    public function getStyleData()
79
    {
80
        return $this->style;
0 ignored issues
show
Bug introduced by
The property style does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
81
    }
82
83
    public function setStyle($style)
84
    {
85
        $this->style = $style;
86
    }
87
88
    public function getAlt()
89
    {
90
        return $this->alt;
91
    }
92
93
    public function setAlt($alt)
94
    {
95
        $this->alt = $alt;
96
    }
97
98
    public function getWidth()
99
    {
100
        return $this->width;
101
    }
102
103
    public function setWidth($width)
104
    {
105
        $this->width = $width;
106
    }
107
108
    public function getHeight()
109
    {
110
        return $this->height;
111
    }
112
113
    public function setHeight($height)
114
    {
115
        $this->height = $height;
116
    }
117
118
    public function getCropCoordinates()
119
    {
120
        return $this->cropCoordinates;
121
    }
122
123
    public function setCropCoordinates($cords)
124
    {
125
        $this->cropCoordinates = $cords;
126
    }
127
128
    public function setFile(UploadedFile $file)
129
    {
130
        $this->file = $file;
131
    }
132
133
    public function getFile()
134
    {
135
        return $this->file;
136
    }
137
138
    public function setSrc($src)
139
    {
140
        $this->src = $src;
141
    }
142
143
    public function getSrc()
144
    {
145
        return $this->src;
146
    }
147
}