Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| BelgaArticleParser | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| canParse | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| extractData | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSourceName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Services\Parsers; |
| 4 | |
| 5 | use App\Contracts\ArticleParserInterface; |
| 6 | |
| 7 | class BelgaArticleParser implements ArticleParserInterface |
| 8 | { |
| 9 | public function canParse(string $url): bool |
| 10 | { |
| 11 | return str_contains($url, 'belganewsagency.eu'); |
| 12 | } |
| 13 | |
| 14 | public function extractData(string $html): array |
| 15 | { |
| 16 | return BelgaArticlePageParser::extractData($html); |
| 17 | } |
| 18 | |
| 19 | public function getSourceName(): string |
| 20 | { |
| 21 | return 'Belga News Agency'; |
| 22 | } |
| 23 | } |