Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
AnyMediaWikiFileUrlChecker | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
checkSourceUrl | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace FileImporter\Remote\MediaWiki; |
4 | |
5 | use FileImporter\Data\SourceUrl; |
6 | use FileImporter\Interfaces\SourceUrlChecker; |
7 | |
8 | /** |
9 | * This SourceUrlChecker implementation will allow any file from any mediawiki website. |
10 | * |
11 | * @license GPL-2.0-or-later |
12 | * @author Addshore |
13 | */ |
14 | class AnyMediaWikiFileUrlChecker implements SourceUrlChecker { |
15 | use MediaWikiSourceUrlParser; |
16 | |
17 | /** |
18 | * @inheritDoc |
19 | */ |
20 | public function checkSourceUrl( SourceUrl $sourceUrl ): bool { |
21 | return $this->parseTitleFromSourceUrl( $sourceUrl ) !== null; |
22 | } |
23 | |
24 | } |