jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/394240 )
Change subject: Re-enable
MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic sniff
......................................................................
Re-enable MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic sniff
Bug: T170580
Change-Id: I0a0055f1de57f15a45c21e2f51ed275a2b249440
---
M .phpcs.xml
M includes/ApiQueryExtracts.php
M includes/ExtractFormatter.php
3 files changed, 37 insertions(+), 4 deletions(-)
Approvals:
jenkins-bot: Verified
Jdlrobson: Looks good to me, approved
diff --git a/.phpcs.xml b/.phpcs.xml
index 93accee..3839d78 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -1,8 +1,6 @@
<?xml version="1.0"?>
<ruleset>
- <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
- </rule>
+ <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
<file>.</file>
<arg name="extensions" value="php,php5,inc" />
<arg name="encoding" value="UTF-8" />
diff --git a/includes/ApiQueryExtracts.php b/includes/ApiQueryExtracts.php
index 92ec8c5..9b0e845 100644
--- a/includes/ApiQueryExtracts.php
+++ b/includes/ApiQueryExtracts.php
@@ -59,11 +59,22 @@
*/
private $supportedContentModels = [ 'wikitext' ];
+ /**
+ * @param \ApiQuery $query API query module object
+ * @param string $moduleName Name of this query module
+ * @param Config $conf MediaWiki configuration
+ * @return ApiQueryExtracts
+ */
public function __construct( $query, $moduleName, Config $conf ) {
parent::__construct( $query, $moduleName, 'ex' );
$this->config = $conf;
}
+ /**
+ * Evaluates the parameters, performs the requested extraction of text,
+ * and sets up the result
+ * @return null
+ */
public function execute() {
$titles = $this->getPageSet()->getGoodTitles();
if ( count( $titles ) == 0 ) {
@@ -120,6 +131,10 @@
}
}
+ /**
+ * @param array $params Ignored parameters
+ * @return string
+ */
public function getCacheMode( $params ) {
return 'public';
}
@@ -394,6 +409,10 @@
return "\n$text";
}
+ /**
+ * Return an array describing all possible parameters to this module
+ * @return array
+ */
public function getAllowedParams() {
return [
'chars' => [
@@ -437,6 +456,10 @@
];
}
+ /**
+ * @see ApiBase::getHelpUrls()
+ * @return string
+ */
public function getHelpUrls() {
return
'https://www.mediawiki.org/wiki/Extension:TextExtracts#API';
}
diff --git a/includes/ExtractFormatter.php b/includes/ExtractFormatter.php
index 191695c..f1600e0 100644
--- a/includes/ExtractFormatter.php
+++ b/includes/ExtractFormatter.php
@@ -49,7 +49,15 @@
}
}
- public function getText( $dummy = null ) {
+ /**
+ * Performs final transformations (such as newline replacement for
plaintext
+ * option) and returns resulting HTML.
+ *
+ * @param DOMElement|string|null $element ID of element to get HTML
from.
+ * Ignored
+ * @return string Processed HTML
+ */
+ public function getText( $element = null ) {
$this->filterContent();
$text = parent::getText();
if ( $this->plainText ) {
@@ -64,6 +72,10 @@
return $text;
}
+ /**
+ * @param string $html HTML string to process
+ * @return string Processed HTML
+ */
public function onHtmlReady( $html ) {
if ( $this->plainText ) {
$html = preg_replace( '/\s*(<h([1-6])\b)/i',
--
To view, visit https://gerrit.wikimedia.org/r/394240
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0a0055f1de57f15a45c21e2f51ed275a2b249440
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/TextExtracts
Gerrit-Branch: master
Gerrit-Owner: Pppery <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Pmiazga <[email protected]>
Gerrit-Reviewer: Pppery <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits