mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS
synced 2024-11-23 15:26:49 +00:00
Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation and to remove the exclusion of the sniff. The activated sniff avoids that new code is missing doc-typehints or real-typehints. Adding a @var type to RSSData->items triggers a SecurityCheck-XSS issue by phan, but all is dealing with wikitext when building the items, so that looks like a false positive Change-Id: I4f1d17372d62f02fe7447f5bf5e75b9471d7a338
This commit is contained in:
parent
32b1a25768
commit
2cc29f25a0
|
@ -2,8 +2,6 @@
|
|||
<ruleset>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
|
||||
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected" />
|
||||
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic" />
|
||||
</rule>
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php" />
|
||||
|
|
|
@ -98,6 +98,7 @@ class Hooks implements ParserFirstCallInitHook {
|
|||
return Utils::getErrorHtml( 'rss-empty', htmlspecialchars( $input ) );
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line SecurityCheck-XSS
|
||||
return $rss->renderFeed( $parser, $frame );
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,9 @@ use DOMDocument;
|
|||
use DOMXPath;
|
||||
|
||||
class RSSData {
|
||||
/** @var string */
|
||||
public $error;
|
||||
/** @var string[][] */
|
||||
public $items;
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,20 +16,35 @@ use WANObjectCache;
|
|||
use Wikimedia\AtEase\AtEase;
|
||||
|
||||
class RSSParser {
|
||||
/** @var int */
|
||||
protected $maxheads = 32;
|
||||
/** @var string */
|
||||
protected $date = "Y-m-d H:i:s";
|
||||
/** @var int */
|
||||
protected $ItemMaxLength = 200;
|
||||
/** @var bool */
|
||||
protected $reversed = false;
|
||||
/** @var string[] */
|
||||
protected $highlight = [];
|
||||
/** @var string[] */
|
||||
protected $filter = [];
|
||||
/** @var string[] */
|
||||
protected $filterOut = [];
|
||||
/** @var string */
|
||||
protected $itemTemplate;
|
||||
/** @var string */
|
||||
protected $url;
|
||||
/** @var string */
|
||||
protected $etag;
|
||||
/** @var int */
|
||||
protected $lastModified;
|
||||
/** @var DOMDocument */
|
||||
protected $xml;
|
||||
/** @var string[] */
|
||||
protected $displayFields = [ 'author', 'title', 'encodedContent', 'description' ];
|
||||
/** @var string[] */
|
||||
protected $stripItems;
|
||||
/** @var string */
|
||||
protected $markerString;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue