Use modern str_starts_with() and [ ... ] syntax

Change-Id: I2f2182e1e0850d7ebf832b7b8e0630ce56aad88b
This commit is contained in:
thiemowmde 2024-04-11 14:07:43 +02:00
parent 6bdde6553b
commit c9f8343173
3 changed files with 3 additions and 3 deletions

View file

@ -64,7 +64,7 @@ class UserVisibleException extends ExceptionBase {
// abusefilter-exception-unknownfunction, abusefilter-exception-usebuiltin
return new Message(
'abusefilter-exception-' . $this->mExceptionID,
array_merge( [ $this->mPosition ], $this->mParams )
[ $this->mPosition, ...$this->mParams ]
);
}

View file

@ -16,7 +16,7 @@ class UserVisibleWarning extends UserVisibleException {
// abusefilter-parser-warning-match-empty-regex
return new Message(
'abusefilter-parser-warning-' . $this->mExceptionID,
array_merge( [ $this->mPosition ], $this->mParams )
[ $this->mPosition, ...$this->mParams ]
);
}
}

View file

@ -229,7 +229,7 @@ class LazyVariableComputer {
// this inference is ugly, but the name isn't accessible from here
// and we only want this for debugging
$textVar = $parameters['text-var'];
$varName = strpos( $textVar, 'old_' ) === 0 ? 'old_links' : 'all_links';
$varName = str_starts_with( $textVar, 'old_' ) ? 'old_links' : 'all_links';
if ( $parameters['forFilter'] ?? false ) {
$this->logger->debug( "Loading $varName from DB" );
$links = $this->getLinksFromDB( $article );