Use single quotes instead of double quotes

https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#String_literals
Single quotes are preferred in all cases where they are equivalent to double quotes.

Change-Id: I808927475e3063a1a37fff9ab851d292acd847bf
This commit is contained in:
Fomafix 2023-10-20 12:26:37 +00:00
parent 6811839c39
commit 83e425ab5a
3 changed files with 11 additions and 11 deletions

View file

@ -56,7 +56,7 @@ class Search {
'slot_content_id = content_id',
$dbr->buildIntegerCast( 'SUBSTR(content_address, 4)' ) . ' = old_id'
];
if ( $pageLimit === null || $pageLimit === "" ) {
if ( $pageLimit === null || $pageLimit === '' ) {
$pageLimit = $wgReplaceTextResultsLimit;
}
self::categoryCondition( $category, $tables, $conds );
@ -153,7 +153,7 @@ class Search {
$comparisonCond,
'page_namespace' => $namespaces,
];
if ( $pageLimit === null || $pageLimit === "" ) {
if ( $pageLimit === null || $pageLimit === '' ) {
$pageLimit = $wgReplaceTextResultsLimit;
}
self::categoryCondition( $category, $tables, $conds );

View file

@ -729,11 +729,11 @@ class SpecialReplaceText extends SpecialPage {
// Group namespaces into rows according to subject.
// Try not to make too many assumptions about namespace numbering.
$rows = [];
$tables = "";
$tables = '';
foreach ( $namespaces as $ns => $name ) {
$subj = $this->namespaceInfo->getSubject( $ns );
if ( !array_key_exists( $subj, $rows ) ) {
$rows[$subj] = "";
$rows[$subj] = '';
}
$name = str_replace( '_', ' ', $name );
if ( $name == '' ) {
@ -792,8 +792,8 @@ class SpecialReplaceText extends SpecialPage {
$out->addHTML( Html::hidden( 'ns' . $ns, 1 ) );
}
$out->addModules( "ext.ReplaceText" );
$out->addModuleStyles( "ext.ReplaceTextStyles" );
$out->addModules( 'ext.ReplaceText' );
$out->addModuleStyles( 'ext.ReplaceTextStyles' );
// Only show "invert selections" link if there are more than
// five pages.
@ -819,7 +819,7 @@ class SpecialReplaceText extends SpecialPage {
*/
[ $title, $context, $role ] = $title_and_context;
$checkbox = new OOUI\CheckboxInputWidget( [
'name' => $title->getArticleID() . "|" . $role,
'name' => $title->getArticleID() . '|' . $role,
'selected' => true
] );
if ( $role === SlotRecord::MAIN ) {

View file

@ -8,12 +8,12 @@ use MediaWiki\Extension\ReplaceText\Search;
class SearchTest extends \MediaWikiUnitTestCase {
public function testGetReplacedText() {
$text = "This is the line being tested";
$search = "line";
$replacement = "word";
$text = 'This is the line being tested';
$search = 'line';
$replacement = 'word';
$regex = false;
$op = Search::getReplacedText( $text, $search, $replacement, $regex );
$trueOp = "This is the word being tested";
$trueOp = 'This is the word being tested';
$this->assertSame( $trueOp, $op );
}
}