Merge "Phan wasn't checking the editcheck includes"

This commit is contained in:
jenkins-bot 2024-06-10 15:34:06 +00:00 committed by Gerrit Code Review
commit 9690972d22
2 changed files with 6 additions and 0 deletions

View file

@ -6,6 +6,7 @@ $cfg['directory_list'] = array_merge(
$cfg['directory_list'],
[
'../../extensions/BetaFeatures',
'editcheck/includes',
]
);

View file

@ -12,11 +12,13 @@ use Wikimedia\ParamValidator\ParamValidator;
class ApiEditCheckReferenceUrl extends ApiBase {
/** @phan-suppress-next-line PhanUndeclaredTypeProperty */
private ?BlockedDomainStorage $blockedDomainStorage;
public function __construct(
ApiMain $main,
string $name,
// @phan-suppress-next-line PhanUndeclaredTypeParameter
?BlockedDomainStorage $blockedDomainStorage
) {
parent::__construct( $main, $name );
@ -46,7 +48,9 @@ class ApiEditCheckReferenceUrl extends ApiBase {
return false;
}
// @phan-suppress-next-line PhanUndeclaredClassMethod
$domain = $this->blockedDomainStorage->validateDomain( $url );
// @phan-suppress-next-line PhanUndeclaredClassMethod
$blockedDomains = $this->blockedDomainStorage->loadComputed();
return !empty( $blockedDomains[ $domain ] );
}
@ -60,6 +64,7 @@ class ApiEditCheckReferenceUrl extends ApiBase {
$url = 'https://' . $url;
}
// @phan-suppress-next-line PhanUndeclaredClassMethod
$matches = BaseBlacklist::getSpamBlacklist()->filter(
[ $url ],
null,