diff options
-rw-r--r-- | includes/ForeignResourceManager.php | 2 | ||||
-rw-r--r-- | includes/GlobalFunctions.php | 2 | ||||
-rw-r--r-- | includes/ResourceLoader/LessVarFileModule.php | 2 | ||||
-rw-r--r-- | includes/Rest/Handler/TransformHandler.php | 2 | ||||
-rw-r--r-- | includes/Storage/NameTableAccessException.php | 2 | ||||
-rw-r--r-- | includes/actions/InfoAction.php | 2 | ||||
-rw-r--r-- | includes/import/ImportStreamSource.php | 2 | ||||
-rw-r--r-- | includes/installer/LocalSettingsGenerator.php | 2 | ||||
-rw-r--r-- | includes/libs/http/MultiHttpClient.php | 2 | ||||
-rw-r--r-- | includes/pager/ReverseChronologicalPager.php | 2 | ||||
-rw-r--r-- | includes/parser/Parser.php | 8 | ||||
-rw-r--r-- | includes/search/SearchHighlighter.php | 2 | ||||
-rw-r--r-- | includes/specials/SpecialShortPages.php | 4 | ||||
-rw-r--r-- | maintenance/createBotPassword.php | 2 | ||||
-rw-r--r-- | tests/phpunit/MediaWikiUnitTestCase.php | 2 | ||||
-rw-r--r-- | tests/phpunit/unit/includes/exception/MWExceptionHandlerTest.php | 10 |
16 files changed, 24 insertions, 24 deletions
diff --git a/includes/ForeignResourceManager.php b/includes/ForeignResourceManager.php index 3f7db67f90f9..5cd8f66883d4 100644 --- a/includes/ForeignResourceManager.php +++ b/includes/ForeignResourceManager.php @@ -201,7 +201,7 @@ class ForeignResourceManager { $this->verbose( "... passed integrity check for {$src}\n" ); $this->cacheSet( $key, $data ); } elseif ( $this->action === 'make-sri' ) { - $this->output( "Integrity for {$src}\n\tintegrity: ${actualIntegrity}\n" ); + $this->output( "Integrity for {$src}\n\tintegrity: {$actualIntegrity}\n" ); } else { $expectedIntegrity = $integrity ?? 'null'; throw new Exception( "Integrity check failed for {$src}\n" . diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5bc36a64b483..2a96554e2c5b 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1575,7 +1575,7 @@ function wfRecursiveRemoveDir( $dir ) { */ function wfPercent( $nr, int $acc = 2, bool $round = true ) { $accForFormat = $acc >= 0 ? $acc : 0; - $ret = sprintf( "%.${accForFormat}f", $nr ); + $ret = sprintf( "%.{$accForFormat}f", $nr ); return $round ? round( (float)$ret, $acc ) . '%' : "$ret%"; } diff --git a/includes/ResourceLoader/LessVarFileModule.php b/includes/ResourceLoader/LessVarFileModule.php index 6674da1a7017..714b22d35327 100644 --- a/includes/ResourceLoader/LessVarFileModule.php +++ b/includes/ResourceLoader/LessVarFileModule.php @@ -127,7 +127,7 @@ class LessVarFileModule extends FileModule { // but we must still carry on and produce a valid LESS variable declaration, // to avoid a LESS syntax error (T267785). foreach ( $this->lessVariables as $msgKey ) { - $vars['msg-' . $msgKey] = self::wrapAndEscapeMessage( $messages[$msgKey] ?? "⧼${msgKey}⧽" ); + $vars['msg-' . $msgKey] = self::wrapAndEscapeMessage( $messages[$msgKey] ?? "⧼{$msgKey}⧽" ); } return $vars; diff --git a/includes/Rest/Handler/TransformHandler.php b/includes/Rest/Handler/TransformHandler.php index 259d44cd1abb..a57dd21e8337 100644 --- a/includes/Rest/Handler/TransformHandler.php +++ b/includes/Rest/Handler/TransformHandler.php @@ -69,7 +69,7 @@ class TransformHandler extends ParsoidHandler { if ( !isset( $validTransformations[$from] ) || !in_array( $format, $validTransformations[$from], true ) ) { - throw new HttpException( "Invalid transform: ${from}/to/${format}", + throw new HttpException( "Invalid transform: {$from}/to/{$format}", 404 ); } $attribs = &$this->getRequestAttributes(); diff --git a/includes/Storage/NameTableAccessException.php b/includes/Storage/NameTableAccessException.php index e0207ac2f160..9c44346fbc71 100644 --- a/includes/Storage/NameTableAccessException.php +++ b/includes/Storage/NameTableAccessException.php @@ -39,7 +39,7 @@ class NameTableAccessException extends RuntimeException { * @return NameTableAccessException */ public static function newFromDetails( $tableName, $accessType, $accessValue ) { - $message = "Failed to access name from ${tableName} using ${accessType} = ${accessValue}"; + $message = "Failed to access name from {$tableName} using {$accessType} = {$accessValue}"; return new self( $message ); } diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 8f42f53467e2..316f0f621cb7 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -474,7 +474,7 @@ class InfoAction extends FormlessAction { $pageInfo['header-basic'][] = [ // Messages: pageinfo-robot-index, pageinfo-robot-noindex $this->msg( 'pageinfo-robot-policy' ), - $this->msg( "pageinfo-robot-${policy['index']}" ) + $this->msg( "pageinfo-robot-{$policy['index']}" ) ]; $unwatchedPageThreshold = $config->get( MainConfigNames::UnwatchedPageThreshold ); diff --git a/includes/import/ImportStreamSource.php b/includes/import/ImportStreamSource.php index 86f6f07004f2..b86c4ca7527a 100644 --- a/includes/import/ImportStreamSource.php +++ b/includes/import/ImportStreamSource.php @@ -173,7 +173,7 @@ class ImportStreamSource implements ImportSource { # Have to do a DB-key replacement ourselves; otherwise spaces get # URL-encoded to +, which is wrong in this case. Similar to logic in # Title::getLocalURL - $link = $firstIw->getURL( strtr( "${additionalIwPrefixes}Special:Export/$page", + $link = $firstIw->getURL( strtr( "{$additionalIwPrefixes}Special:Export/$page", ' ', '_' ) ); $params = []; diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 37ae9345bf2f..2c634e6dfce0 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -352,7 +352,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { ## (like /w/index.php/Page_title to /wiki/Page_title) please see: ## https://www.mediawiki.org/wiki/Manual:Short_URL \$wgScriptPath = \"{$this->values['wgScriptPath']}\"; -${serverSetting} +{$serverSetting} ## The URL path to static resources (images, scripts, etc.) \$wgResourceBasePath = \$wgScriptPath; diff --git a/includes/libs/http/MultiHttpClient.php b/includes/libs/http/MultiHttpClient.php index dbd25ae6c13b..04ca96309aae 100644 --- a/includes/libs/http/MultiHttpClient.php +++ b/includes/libs/http/MultiHttpClient.php @@ -692,7 +692,7 @@ class MultiHttpClient implements LoggerAwareInterface { } $parsedUrl = wfParseUrl( $req['url'] ); if ( $parsedUrl === false ) { - throw new Exception( "Invalid url specified: ${req['url']}" ); + throw new Exception( "Invalid url specified: {$req['url']}" ); } // Set the current host in the Host header $req['headers']['Host'] = $parsedUrl['host']; diff --git a/includes/pager/ReverseChronologicalPager.php b/includes/pager/ReverseChronologicalPager.php index a3892ef07106..a4fe272394c0 100644 --- a/includes/pager/ReverseChronologicalPager.php +++ b/includes/pager/ReverseChronologicalPager.php @@ -299,6 +299,6 @@ abstract class ReverseChronologicalPager extends IndexPager { $ymd = '20320101'; } - return MWTimestamp::getInstance( "${ymd}000000" ); + return MWTimestamp::getInstance( "{$ymd}000000" ); } } diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index c2e0fe7e5d1a..6d282c72b1e1 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4399,17 +4399,17 @@ class Parser { $anchor = $safeHeadline; $fallbackAnchor = $fallbackHeadline; if ( isset( $refers[$arrayKey] ) ) { - for ( $i = 2; isset( $refers["${arrayKey}_$i"] ); ++$i ); + for ( $i = 2; isset( $refers["{$arrayKey}_$i"] ); ++$i ); $anchor .= "_$i"; $linkAnchor .= "_$i"; - $refers["${arrayKey}_$i"] = true; + $refers["{$arrayKey}_$i"] = true; } else { $refers[$arrayKey] = true; } if ( $fallbackHeadline !== false && isset( $refers[$fallbackArrayKey] ) ) { - for ( $i = 2; isset( $refers["${fallbackArrayKey}_$i"] ); ++$i ); + for ( $i = 2; isset( $refers["{$fallbackArrayKey}_$i"] ); ++$i ); $fallbackAnchor .= "_$i"; - $refers["${fallbackArrayKey}_$i"] = true; + $refers["{$fallbackArrayKey}_$i"] = true; } else { $refers[$fallbackArrayKey] = true; } diff --git a/includes/search/SearchHighlighter.php b/includes/search/SearchHighlighter.php index 3e97affc5b43..79c6b6fabe29 100644 --- a/includes/search/SearchHighlighter.php +++ b/includes/search/SearchHighlighter.php @@ -569,7 +569,7 @@ class SearchHighlighter { $pat2 = '/(' . $terms . ")/i"; $line = preg_replace( $pat2, "<span class='searchmatch'>\\1</span>", $line ); - $extract .= "${line}\n"; + $extract .= "{$line}\n"; } return $extract; diff --git a/includes/specials/SpecialShortPages.php b/includes/specials/SpecialShortPages.php index ef72f4bcc432..17dcf77dc397 100644 --- a/includes/specials/SpecialShortPages.php +++ b/includes/specials/SpecialShortPages.php @@ -188,8 +188,8 @@ class SpecialShortPages extends QueryPage { $size = $this->msg( 'nbytes' )->numParams( $result->value )->escaped(); return $exists - ? "${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]" - : "<del>${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>"; + ? "{$hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]" + : "<del>{$hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>"; } protected function getGroupName() { diff --git a/maintenance/createBotPassword.php b/maintenance/createBotPassword.php index e7bc4ca42568..5e5663eba50d 100644 --- a/maintenance/createBotPassword.php +++ b/maintenance/createBotPassword.php @@ -125,7 +125,7 @@ class CreateBotPassword extends Maintenance { if ( $status->isGood() ) { $this->output( "Success.\n" ); - $this->output( "Log in using username:'${username}@${appId}' and password:'${password}'.\n" ); + $this->output( "Log in using username:'{$username}@{$appId}' and password:'{$password}'.\n" ); } else { $this->fatalError( "Bot password creation failed. Does this appid already exist for the user perhaps?\n\nErrors:\n" . diff --git a/tests/phpunit/MediaWikiUnitTestCase.php b/tests/phpunit/MediaWikiUnitTestCase.php index 18fd7eb17673..bdd7a442375d 100644 --- a/tests/phpunit/MediaWikiUnitTestCase.php +++ b/tests/phpunit/MediaWikiUnitTestCase.php @@ -74,7 +74,7 @@ abstract class MediaWikiUnitTestCase extends TestCase { final public static function mediaWikiSetUpBeforeClass(): void { $reflection = new ReflectionClass( static::class ); $dirSeparator = DIRECTORY_SEPARATOR; - if ( stripos( $reflection->getFileName(), "${dirSeparator}unit${dirSeparator}" ) === false ) { + if ( stripos( $reflection->getFileName(), "{$dirSeparator}unit{$dirSeparator}" ) === false ) { self::fail( 'This unit test needs to be in "tests/phpunit/unit"!' ); } diff --git a/tests/phpunit/unit/includes/exception/MWExceptionHandlerTest.php b/tests/phpunit/unit/includes/exception/MWExceptionHandlerTest.php index 0074d5ffb108..d017621e8286 100644 --- a/tests/phpunit/unit/includes/exception/MWExceptionHandlerTest.php +++ b/tests/phpunit/unit/includes/exception/MWExceptionHandlerTest.php @@ -46,11 +46,11 @@ class MWExceptionHandlerTest extends \MediaWikiUnitTestCase { $dummyFile = TestThrowerDummy::getFile(); $dummyClass = TestThrowerDummy::class; $expected = <<<TEXT -from ${dummyFile}(17) -#0 ${dummyFile}(13): ${dummyClass}->getQuux() -#1 ${dummyFile}(9): ${dummyClass}->getBar() -#2 ${dummyFile}(5): ${dummyClass}->doFoo() -#3 ${startFile}($startLine): ${dummyClass}->main() +from {$dummyFile}(17) +#0 {$dummyFile}(13): {$dummyClass}->getQuux() +#1 {$dummyFile}(9): {$dummyClass}->getBar() +#2 {$dummyFile}(5): {$dummyClass}->doFoo() +#3 {$startFile}($startLine): {$dummyClass}->main() TEXT; // Trim up until our call() |