Fix excluded phpcs rules

Change-Id: Ie0d0a00e2a12dc50bd2ed9ba00b8e7f339227a56
This commit is contained in:
Sam Wilson 2021-11-02 13:48:27 +08:00
parent 10a35cc513
commit 0744773321
2 changed files with 12 additions and 9 deletions

View file

@ -1,10 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<ruleset> <ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
<exclude name="MediaWiki.Commenting.PropertyDocumentation.WrongStyle" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
</rule>
<file>.</file> <file>.</file>
<arg name="extensions" value="php"/> <arg name="extensions" value="php"/>
<arg name="encoding" value="UTF-8"/> <arg name="encoding" value="UTF-8"/>

View file

@ -10,8 +10,8 @@ use MediaWiki\MediaWikiServices;
use WikimediaEvents\WikimediaEventsHooks; use WikimediaEvents\WikimediaEventsHooks;
class WikiEditorHooks { class WikiEditorHooks {
// ID used for grouping entries all of a session's entries together in
// EventLogging. /** @var string|bool ID used for grouping entries all of a session's entries together in EventLogging. */
private static $statsId = false; private static $statsId = false;
/* Static Methods */ /* Static Methods */
@ -64,7 +64,8 @@ class WikiEditorHooks {
'version' => 1, 'version' => 1,
'is_oversample' => !$inSample, 'is_oversample' => !$inSample,
'editor_interface' => 'wikitext', 'editor_interface' => 'wikitext',
'platform' => 'desktop', // FIXME // @todo FIXME for other than 'desktop'. T249944
'platform' => 'desktop',
'integration' => 'page', 'integration' => 'page',
'page_id' => $page->getId(), 'page_id' => $page->getId(),
'page_title' => $title->getPrefixedText(), 'page_title' => $title->getPrefixedText(),
@ -115,7 +116,8 @@ class WikiEditorHooks {
'feature' => $feature, 'feature' => $feature,
'action' => $action, 'action' => $action,
'editingSessionId' => $sessionId, 'editingSessionId' => $sessionId,
'platform' => 'desktop', // FIXME T249944 // @todo FIXME for other than 'desktop'. T249944
'platform' => 'desktop',
'integration' => 'page', 'integration' => 'page',
'editor_interface' => 'wikitext', 'editor_interface' => 'wikitext',
'user_id' => $user->getId(), 'user_id' => $user->getId(),
@ -288,6 +290,11 @@ class WikiEditorHooks {
]; ];
} }
/**
* @param MessageLocalizer $ml
* @param bool $raw
* @return string
*/
private static function getSignatureMessage( MessageLocalizer $ml, $raw = false ) { private static function getSignatureMessage( MessageLocalizer $ml, $raw = false ) {
$msg = $ml->msg( 'sig-text' )->params( '~~~~' )->inContentLanguage(); $msg = $ml->msg( 'sig-text' )->params( '~~~~' )->inContentLanguage();
return $raw ? $msg->plain() : $msg->text(); return $raw ? $msg->plain() : $msg->text();