mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Fix new documentation sniffs
Change-Id: If9fc2d1d29aefdcb61a5f69c28f7d50c86b3ac4a
This commit is contained in:
parent
6afa14fe4d
commit
a7497703a7
|
@ -1,9 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
|
||||
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
|
||||
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
|
||||
</rule>
|
||||
|
|
|
@ -760,7 +760,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
* Gets the relevant HTML for the latest log entry on a given title, including a full log link.
|
||||
*
|
||||
* @param Title $title Title
|
||||
* @param $types array|string
|
||||
* @param array|string $types
|
||||
* @return string
|
||||
*/
|
||||
private function getLastLogEntry( Title $title, $types = '' ) {
|
||||
|
|
|
@ -210,6 +210,12 @@ class VisualEditorHooks {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Title $title
|
||||
* @param User $user
|
||||
* @param WebRequest $req
|
||||
* @return bool
|
||||
*/
|
||||
private static function isSupportedEditPage( Title $title, User $user, WebRequest $req ) {
|
||||
if ( $req->getVal( 'action' ) !== 'edit' || !$title->quickUserCan( 'edit' ) ) {
|
||||
return false;
|
||||
|
@ -234,6 +240,11 @@ class VisualEditorHooks {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Title $title
|
||||
* @param WebRequest $req
|
||||
* @return bool
|
||||
*/
|
||||
private static function isVisualAvailable( $title, $req ) {
|
||||
$veConfig = MediaWikiServices::getInstance()->getConfigFactory()
|
||||
->makeConfig( 'visualeditor' );
|
||||
|
@ -247,6 +258,11 @@ class VisualEditorHooks {
|
|||
ApiVisualEditor::isAllowedContentType( $veConfig, $title->getContentModel() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Title $title
|
||||
* @param User $user
|
||||
* @return bool
|
||||
*/
|
||||
private static function isWikitextAvailable( $title, $user ) {
|
||||
return $user->getOption( 'visualeditor-newwikitext' ) &&
|
||||
$title->getContentModel() === 'wikitext';
|
||||
|
@ -318,6 +334,11 @@ class VisualEditorHooks {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param WebRequest $req
|
||||
* @return string|null
|
||||
*/
|
||||
private static function getPreferredEditor( User $user, WebRequest $req ) {
|
||||
$config = MediaWikiServices::getInstance()->getConfigFactory()
|
||||
->makeConfig( 'visualeditor' );
|
||||
|
@ -345,6 +366,11 @@ class VisualEditorHooks {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param WebRequest $req
|
||||
* @return string
|
||||
*/
|
||||
private static function getLastEditor( User $user, WebRequest $req ) {
|
||||
// This logic matches getLastEditor in:
|
||||
// modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
|
||||
|
|
Loading…
Reference in a new issue