Page MenuHomeWickedGov Phorge

ChangeStatusLogFormatter.php
No OneTemporary

Size
983 B
Referenced Files
None
Subscribers
None

ChangeStatusLogFormatter.php

<?php
namespace MediaWiki\Extension\CentralAuth\LogFormatter;
use LogFormatter;
/**
* Handles the following log types:
* - globalauth/setstatus
* - suppress/setstatus
*/
class ChangeStatusLogFormatter extends LogFormatter {
private function formatStatuses( array $array ): string {
if ( $array !== [] ) {
$values = array_map( function ( $key ) {
return $this->msg( 'centralauth-log-status-' . $key )->text();
}, $array );
return $this->formatParameterValue( 'list', $values );
}
return $this->msg( 'centralauth-log-status-none' )->text();
}
/** @inheritDoc */
protected function getMessageKey() {
return 'logentry-globalauth-setstatus';
}
protected function extractParameters() {
if ( $this->entry->isLegacy() ) {
return parent::extractParameters();
}
[ 'added' => $added, 'removed' => $removed ] = $this->entry->getParameters();
return [
3 => $this->formatStatuses( $added ),
4 => $this->formatStatuses( $removed ),
];
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 19:30 (4 h, 11 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0b/fa/b84adb7a395658aeae8d46f147aa
Default Alt Text
ChangeStatusLogFormatter.php (983 B)

Event Timeline