Conditions | 3 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 9 |
Ratio | 100 % |
1 | <?php |
||
35 | View Code Duplication | private function validateLink($link) |
|
|
|||
36 | { |
||
37 | if (!$link instanceof PersistentSubscriptionInfoFeedLink) { |
||
38 | throw new \InvalidArgumentException('Invalid link type %s.', get_class($link)); |
||
39 | } |
||
40 | if (isset($this->links[$link->getRelation()])) { |
||
41 | throw new \InvalidArgumentException(sprintf('Link relation %s already there.', $link->getRelation())); |
||
42 | } |
||
43 | } |
||
44 | |||
53 |
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.