Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 0 |
1 | <?php |
||
89 | 2 | protected function validateParams() |
|
90 | { |
||
91 | 2 | if (empty($this->id)) { |
|
92 | 1 | throw WrongData::invalidValuesProvided('ID required to identify a time series dataset.'); |
|
93 | } |
||
94 | |||
95 | 1 | if (empty($this->key)) { |
|
96 | 1 | throw WrongData::invalidValuesProvided( |
|
97 | 1 | 'Key required to identify data within a dataset. A common example is a symbol such as AAPL.' |
|
98 | ); |
||
99 | } |
||
100 | } |
||
101 | } |
||
102 |
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.