mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-11-27 15:30:48 +00:00
Merge "Fix and enable 1 PHPCS exclusion"
This commit is contained in:
commit
6e24f2d1b7
|
@ -4,7 +4,6 @@
|
|||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
|
||||
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected" />
|
||||
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic" />
|
||||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/>
|
||||
</rule>
|
||||
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
|
||||
<exclude-pattern>Scribunto_LuaTitleBlacklistLibrary\.php</exclude-pattern>
|
||||
|
|
|
@ -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' ) {
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue