From fa3ce90851342c8e7f52c18a751079bdecc4c255 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Wed, 15 May 2019 16:04:32 +0200 Subject: [PATCH] Remove comments literally repeating what the code says I find it obvious that a file called "AbuseFilterTokenizerTest" is a "test for the AbuseFilterTokenizer class". A comment that is just repeating this information is typicalls not helpful, but distracting and a potential source of mistakes, e.g. when stuff is copy-pasted, but the comment not adjusted. Change-Id: I1d4cc06e9e5631955ff73bf675090cf9c33c9390 --- includes/AbuseFilter.php | 3 --- includes/Views/AbuseFilterViewDiff.php | 2 -- includes/Views/AbuseFilterViewEdit.php | 1 - tests/phpunit/AFPDataTest.php | 2 -- tests/phpunit/AbuseFilterParserTest.php | 2 -- tests/phpunit/AbuseFilterTokenizerTest.php | 2 -- 6 files changed, 12 deletions(-) diff --git a/includes/AbuseFilter.php b/includes/AbuseFilter.php index 20503053f..ba1626641 100644 --- a/includes/AbuseFilter.php +++ b/includes/AbuseFilter.php @@ -2608,7 +2608,6 @@ class AbuseFilter { $new_id = $dbw->insertId(); } - // Actions $availableActions = $page->getConfig()->get( 'AbuseFilterActions' ); $actionsRows = []; foreach ( array_filter( $availableActions ) as $action => $_ ) { @@ -2640,7 +2639,6 @@ class AbuseFilter { $afh_row[$afh_col] = $newRow[$af_col]; } - // Actions $displayActions = []; foreach ( $actions as $action ) { $displayActions[$action['action']] = $action['parameters']; @@ -2649,7 +2647,6 @@ class AbuseFilter { $afh_row['afh_changed_fields'] = implode( ',', $differences ); - // Flags $flags = []; if ( $newRow['af_hidden'] ) { $flags[] = 'hidden'; diff --git a/includes/Views/AbuseFilterViewDiff.php b/includes/Views/AbuseFilterViewDiff.php index 077a6761a..34b83f776 100644 --- a/includes/Views/AbuseFilterViewDiff.php +++ b/includes/Views/AbuseFilterViewDiff.php @@ -339,7 +339,6 @@ class AbuseFilterViewDiff extends AbuseFilterView { $body .= $infoHeader . $info; } - // Pattern $patternHeader = $this->getHeaderRow( 'abusefilter-diff-pattern' ); $pattern = ''; $pattern .= $this->getDiffRow( @@ -352,7 +351,6 @@ class AbuseFilterViewDiff extends AbuseFilterView { $body .= $patternHeader . $pattern; } - // Actions $actionsHeader = $this->getHeaderRow( 'abusefilter-edit-consequences' ); $actions = ''; diff --git a/includes/Views/AbuseFilterViewEdit.php b/includes/Views/AbuseFilterViewEdit.php index 6170fad9b..42cee8999 100644 --- a/includes/Views/AbuseFilterViewEdit.php +++ b/includes/Views/AbuseFilterViewEdit.php @@ -1189,7 +1189,6 @@ class AbuseFilterViewEdit extends AbuseFilterView { $row->af_global = $request->getCheck( 'wpFilterGlobal' ) && $this->getConfig()->get( 'AbuseFilterIsCentral' ); - // Actions $actions = []; foreach ( array_filter( $this->getConfig()->get( 'AbuseFilterActions' ) ) as $action => $_ ) { // Check if it's set diff --git a/tests/phpunit/AFPDataTest.php b/tests/phpunit/AFPDataTest.php index b465a2595..f644c78e3 100644 --- a/tests/phpunit/AFPDataTest.php +++ b/tests/phpunit/AFPDataTest.php @@ -1,7 +1,5 @@