Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
AnyMediaWikiFileUrlChecker
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 checkSourceUrl
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace FileImporter\Remote\MediaWiki;
4
5use FileImporter\Data\SourceUrl;
6use 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 */
14class 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}