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