From 70754ecf3782544c5ad4f7564b47f80cbc8c3a8c Mon Sep 17 00:00:00 2001 From: Reedy Date: Fri, 8 Apr 2022 14:20:55 +0100 Subject: [PATCH] Fix and enable 1 PHPCS exclusion Change-Id: I15c2af8205f58f774b77bff52cad38e0cf541014 --- .phpcs.xml | 1 - includes/TitleBlacklist.php | 3 ++- includes/TitleBlacklistEntry.php | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 79ae04de..57aa2f48 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -4,7 +4,6 @@ - Scribunto_LuaTitleBlacklistLibrary\.php diff --git a/includes/TitleBlacklist.php b/includes/TitleBlacklist.php index 74ac2eda..81c00898 100644 --- a/includes/TitleBlacklist.php +++ b/includes/TitleBlacklist.php @@ -125,7 +125,8 @@ class TitleBlacklist { */ private static function getBlacklistText( $source ) { if ( !is_array( $source ) || count( $source ) <= 0 ) { - return ''; // Return empty string in error case + // Return empty string in error case + return ''; } if ( $source['type'] == 'message' ) { diff --git a/includes/TitleBlacklistEntry.php b/includes/TitleBlacklistEntry.php index f5f16625..8c9b3ade 100644 --- a/includes/TitleBlacklistEntry.php +++ b/includes/TitleBlacklistEntry.php @@ -172,7 +172,8 @@ class TitleBlacklistEntry { * @return TitleBlacklistEntry|null */ public static function newFromString( $line, $source ) { - $raw = $line; // Keep line for raw data + // Keep line for raw data + $raw = $line; $options = []; // Strip comments $line = preg_replace( "/^\\s*([^#]*)\\s*((.*)?)$/", "\\1", $line ); @@ -187,7 +188,8 @@ class TitleBlacklistEntry { return null; } $regex = trim( $pockets[1] ); - $regex = str_replace( '_', ' ', $regex ); // We'll be matching against text form + // We'll be matching against text form + $regex = str_replace( '_', ' ', $regex ); $opts_str = isset( $pockets[3] ) ? trim( $pockets[3] ) : ''; // Parse opts $opts = preg_split( '/\s*\|\s*/', $opts_str );