Item::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 8
loc 8
ccs 7
cts 7
cp 1
rs 9.4285
cc 1
eloc 6
nc 1
nop 5
crap 1
1
<?php
2
/**
3
 * AnimeDb package.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
8
 */
9
10
namespace AnimeDb\Bundle\CatalogBundle\Plugin\Fill\Refiller;
11
12
/**
13
 * Element search results.
14
 *
15
 * @author  Peter Gribanov <[email protected]>
16
 */
17 View Code Duplication
class Item
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /**
20
     * Name.
21
     *
22
     * @var string
23
     */
24
    protected $name = '';
25
26
    /**
27
     * Data for refill item.
28
     *
29
     * @var array
30
     */
31
    protected $data = [];
32
33
    /**
34
     * Source.
35
     *
36
     * Can set the source to source item to avoid the next search for this item
37
     *
38
     * @var string
39
     */
40
    protected $source = '';
41
42
    /**
43
     * Image.
44
     *
45
     * @var string
46
     */
47
    protected $image = '';
48
49
    /**
50
     * Description.
51
     *
52
     * @var string
53
     */
54
    protected $description = '';
55
56
    /**
57
     * Construct.
58
     *
59
     * @param string $name
60
     * @param array $data
61
     * @param string $source
62
     * @param string|null $image
63
     * @param string|null $description
64
     */
65 1
    public function __construct($name, array $data, $source, $image = '', $description = '')
66
    {
67 1
        $this->name = $name;
68 1
        $this->data = $data;
69 1
        $this->source = $source;
70 1
        $this->image = $image;
71 1
        $this->description = $description;
72 1
    }
73
74
    /**
75
     * Get name.
76
     *
77
     * @return string
78
     */
79 1
    public function getName()
80
    {
81 1
        return $this->name;
82
    }
83
84
    /**
85
     * Get data for refill item.
86
     *
87
     * @return array
88
     */
89 1
    public function getData()
90
    {
91 1
        return $this->data;
92
    }
93
94
    /**
95
     * Get source.
96
     *
97
     * @return string
98
     */
99 1
    public function getSource()
100
    {
101 1
        return $this->source;
102
    }
103
104
    /**
105
     * Get image.
106
     *
107
     * @return string
108
     */
109 1
    public function getImage()
110
    {
111 1
        return $this->image;
112
    }
113
114
    /**
115
     * Get description.
116
     *
117
     * @return string
118
     */
119 1
    public function getDescription()
120
    {
121 1
        return $this->description;
122
    }
123
}
124