Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function findByName(string $name): NewsletterList |
||
32 | { |
||
33 | if ($name === '') { |
||
34 | return $this->getDefault(); |
||
35 | } |
||
36 | |||
37 | foreach ($this->items as $newsletterList) { |
||
38 | if ($newsletterList->getName() === $name) { |
||
39 | return $newsletterList; |
||
40 | } |
||
41 | } |
||
42 | |||
43 | throw InvalidNewsletterList::noListWithName($name); |
||
44 | } |
||
45 | |||
57 |