mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Mark two private methods as such
Not used anywhere else: https://codesearch.wmcloud.org/search/?q=stringifyActions https://codesearch.wmcloud.org/search/?q=normalizeBlocks This patch also moves that [ '' ] fallback out of a method where it was misplaced. That fallback is very specific for the diff algorithm, but not something one would expect from a method called "stringifyActions". Change-Id: I458eef61c6b6741bbd433ea26a012aaeb01cea3f
This commit is contained in:
parent
34968d783e
commit
e45ce1f5bd
|
@ -370,8 +370,8 @@ class AbuseFilterViewDiff extends AbuseFilterView {
|
|||
|
||||
$actions = $this->getDiffRow(
|
||||
'abusefilter-edit-consequences',
|
||||
$this->stringifyActions( $oldVersion['actions'] ),
|
||||
$this->stringifyActions( $newVersion['actions'] )
|
||||
$this->stringifyActions( $oldVersion['actions'] ) ?: [ '' ],
|
||||
$this->stringifyActions( $newVersion['actions'] ) ?: [ '' ]
|
||||
);
|
||||
|
||||
if ( $actions !== '' ) {
|
||||
|
@ -392,7 +392,7 @@ class AbuseFilterViewDiff extends AbuseFilterView {
|
|||
* @param string[][] $actions
|
||||
* @return string[]
|
||||
*/
|
||||
public function stringifyActions( $actions ) {
|
||||
private function stringifyActions( array $actions ) : array {
|
||||
$lines = [];
|
||||
|
||||
ksort( $actions );
|
||||
|
@ -400,10 +400,6 @@ class AbuseFilterViewDiff extends AbuseFilterView {
|
|||
$lines[] = AbuseFilter::formatAction( $action, $parameters, $this->getLanguage() );
|
||||
}
|
||||
|
||||
if ( !count( $lines ) ) {
|
||||
$lines[] = '';
|
||||
}
|
||||
|
||||
return $lines;
|
||||
}
|
||||
|
||||
|
|
|
@ -1096,7 +1096,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
* @param string[] $durations
|
||||
* @return string[]
|
||||
*/
|
||||
protected static function normalizeBlocks( array $durations ) {
|
||||
private static function normalizeBlocks( array $durations ) {
|
||||
global $wgAbuseFilterBlockDuration, $wgAbuseFilterAnonBlockDuration;
|
||||
// We need to have same values since it may happen that ipblocklist
|
||||
// and one (or both) of the global variables use different wording
|
||||
|
|
Loading…
Reference in a new issue