Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public static function fromURL(string $url): ?MapperInterface |
||
25 | { |
||
26 | if (preg_match('#^https?://(www\.)?lemonde\.fr/[^ ]+$#i', $url)) { |
||
27 | return new LeMondeMapper(); |
||
28 | } |
||
29 | if (preg_match('#^https?://(www\.)?lefigaro\.fr/[^ ]+$#i', $url)) { |
||
30 | return new FigaroMapper(); |
||
31 | } |
||
32 | if (preg_match('#^https?://(www\.)?liberation\.fr/[^ ]+$#i', $url)) { |
||
33 | return new LiberationMapper(); |
||
34 | } |
||
35 | if (preg_match('#^https?://(www\.)?la-croix\.com/[^ ]+$#i', $url)) { |
||
36 | return new LaCroixMapper(); |
||
37 | } |
||
38 | |||
39 | |||
40 | return null; |
||
41 | } |
||
43 |