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...
21
{
22
/**
23
* @var array
24
*/
25
private $errors;
26
27
/**
28
* @var \DateTime
29
*/
30
private $date;
31
32
2
public function __construct(array $errors, \DateTime $date)
33
{
34
2
$this->errors = $errors;
35
2
$this->date = $date;
36
2
}
37
38
/**
39
* Get errors.
40
*
41
* @return array
42
*/
43
public function getErrors()
44
{
45
return $this->errors;
46
}
47
48
/**
49
* Get date for which rates are fetched.
50
*
51
* @return \DateTime
52
*/
53
public function getDate()
54
{
55
return $this->date;
56
}
57
58
/**
59
* {@inheritdoc}
60
*/
61
public function getIterator()
62
{
63
return new \ArrayIterator($this->errors);
64
}
65
66
/**
67
* {@inheritdoc}
68
*/
69
public function offsetExists($offset)
70
{
71
return isset($this->errors[$offset]);
72
}
73
74
/**
75
* {@inheritdoc}
76
*/
77
1
public function offsetGet($offset)
78
{
79
1
return $this->errors[$offset];
80
}
81
82
/**
83
* {@inheritdoc}
84
*/
85
public function offsetSet($offset, $value)
86
{
87
throw new LogicException(sprintf('Method "%s" of class "%s" can not be invoked in this context.', __FUNCTION__, __CLASS__));
88
}
89
90
/**
91
* {@inheritdoc}
92
*/
93
public function offsetUnset($offset)
94
{
95
throw new LogicException(sprintf('Method "%s" of class "%s" can not be invoked in this context.', __FUNCTION__, __CLASS__));
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.