Umherirrender has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/371009 )
Change subject: Improve some parameter docs
......................................................................
Improve some parameter docs
Change-Id: Id5bd8954790c38084ae6e6e38927dcb30772533b
---
M WikimediaEventsHooks.php
M composer.json
M includes/AuthManagerStatsdHandler.php
M phpcs.xml
M tests/browser/SearchSatisfactionTests.php
5 files changed, 37 insertions(+), 25 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents
refs/changes/09/371009/1
diff --git a/WikimediaEventsHooks.php b/WikimediaEventsHooks.php
index ec50dfe..0d8b7e5 100644
--- a/WikimediaEventsHooks.php
+++ b/WikimediaEventsHooks.php
@@ -35,6 +35,8 @@
* special page)
*
* Add a 'loggedIn' key with the value of 1 if the user is logged in
+ * @param OutputPage $out
+ * @param array &$headerItems
*/
public static function onXAnalyticsHeader( OutputPage $out, array
&$headerItems ) {
$title = $out->getTitle();
@@ -70,6 +72,9 @@
* @param bool $isWatch
* @param string $section
* @param int $flags
+ * @param Revision $revision
+ * @param Status $status
+ * @param int $baseRevId
* @see
https://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete
* @see https://meta.wikimedia.org/wiki/Schema:PageContentSaveComplete
*/
@@ -205,11 +210,11 @@
* Handler for UserSaveOptions hook.
* @see http://www.mediawiki.org/wiki/Manual:Hooks/UserSaveOptions
* @param User $user user whose options are being saved
- * @param array $options Options being saved
+ * @param array &$options Options being saved
* @return bool true in all cases
*/
- // Modified version of original method from the Echo extension
public static function onUserSaveOptions( $user, &$options ) {
+ // Modified version of original method from the Echo extension
global $wgOut;
// Capture user options saved via Special:Preferences or
ApiOptions
@@ -256,7 +261,8 @@
* @param WikiPage $article The article that was deleted
* @param User $user The user that deleted the article
* @param string $reason The reason that the article was deleted
- * @param integer $id The ID of the article that was deleted
+ * @param int $id The ID of the article that was deleted
+ * @return true
*/
public static function onArticleDeleteComplete( WikiPage $article, User
$user, $reason, $id ) {
$title = $article->getTitle();
@@ -277,9 +283,9 @@
* @see http://www.mediawiki.org/wiki/Manual:Hooks/ArticleUndelete
* @see https://meta.wikimedia.org/wiki/Schema:PageRestoration
* @param Title $title Title of article restored
- * @param boolean $created whether the revision created the page
(default false)
+ * @param bool $created whether the revision created the page (default
false)
* @param string $comment Reason for undeleting the page
- * @param integer $oldPageId The ID of the article that was deleted
+ * @param int $oldPageId The ID of the article that was deleted
*/
public static function onArticleUndelete( $title, $created, $comment,
$oldPageId ) {
global $wgUser;
@@ -327,8 +333,8 @@
* @param Title $oldTitle The title of the old article (moved from)
* @param Title $newTitle The title of the new article (moved to)
* @param User $user The user who moved the article
- * @param integer $pageId The page ID of the old article
- * @param integer $redirectId The page ID of the redirect, 0 if a
redirect wasn't
+ * @param int $pageId The page ID of the old article
+ * @param int $redirectId The page ID of the redirect, 0 if a redirect
wasn't created
* created
* @param string $reason The reason that the title was moved
* @return bool true in all cases
@@ -361,16 +367,17 @@
*
* @see
https://www.mediawiki.org/wiki/Manual:Hooks/PageContentInsertComplete
* @see https://meta.wikimedia.org/wiki/Schema:PageCreation
- * @param WikiPage $wikipage page just created
+ * @param WikiPage $wikiPage page just created
* @param User $user user who created the page
* @param Content $content content of new page
* @param string $summary summary given by creating user
* @param bool $isMinor whether the edit is marked as minor (not
actually possible for new
* pages)
- * @param $isWatch not used
- * @param $section not used
+ * @param bool $isWatch not used
+ * @param string $section not used
* @param int $flags bit flags about page creation
* @param Revision $revision first revision of new page
+ * @return true
*/
public static function onPageContentInsertComplete( WikiPage $wikiPage,
User $user,
Content $content, $summary, $isMinor, $isWatch, $section,
$flags, Revision $revision ) {
@@ -464,6 +471,10 @@
* The javascript that records search metrics needs to know if it is on
a
* SERP or not. This ends up being non-trivial due to localization, so
* make it trivial by injecting a boolean value to check.
+ * @param string $term
+ * @param SearchResultSet $titleMatches
+ * @param SearchResultSet $textMatches
+ * @return true
*/
public static function onSpecialSearchResults( $term, $titleMatches,
$textMatches ) {
global $wgOut;
@@ -479,7 +490,7 @@
* Add a change tag 'cross-wiki-upload' to cross-wiki uploads to
Commons, to track usage of the
* new feature. (Both to track adoption, and to let Commons editors
review the uploads.) (T115328)
*
- * @param $recentChange RecentChange
+ * @param RecentChange $recentChange
* @return bool
*/
public static function onRecentChangeSave( RecentChange $recentChange )
{
@@ -553,7 +564,7 @@
/**
* AbuseFilter-builder hook handler
*
- * @param array $builder
+ * @param array &$builder
* @return bool
*/
public static function onAbuseFilterBuilder( &$builder ) {
diff --git a/composer.json b/composer.json
index 797d249..60cfe3e 100644
--- a/composer.json
+++ b/composer.json
@@ -13,7 +13,7 @@
"scripts": {
"fix": "phpcbf",
"test": [
- "parallel-lint . --exclude vendor",
+ "parallel-lint . --exclude vendor --exclude
node_modules",
"phpcs -p -s"
]
}
diff --git a/includes/AuthManagerStatsdHandler.php
b/includes/AuthManagerStatsdHandler.php
index 270c5f1..0bad073 100644
--- a/includes/AuthManagerStatsdHandler.php
+++ b/includes/AuthManagerStatsdHandler.php
@@ -48,7 +48,7 @@
class AuthManagerStatsdHandler extends AbstractHandler {
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
public function handle( array $record ) {
$event = $this->getField( 'event', $record['context'] );
diff --git a/phpcs.xml b/phpcs.xml
index 580bea2..21b2bef 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,19 +2,11 @@
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.ParamNameNoCaseMatch" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
- <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle"
/>
<exclude
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
<exclude
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
</rule>
<file>.</file>
<arg name="extensions" value="php,php5,inc" />
- <arg name="encoding" value="utf8" />
- <exclude-pattern>vendor</exclude-pattern>
- <exclude-pattern>node_modules</exclude-pattern>
+ <arg name="encoding" value="UTF-8" />
</ruleset>
diff --git a/tests/browser/SearchSatisfactionTests.php
b/tests/browser/SearchSatisfactionTests.php
index bbde015..6e48491 100644
--- a/tests/browser/SearchSatisfactionTests.php
+++ b/tests/browser/SearchSatisfactionTests.php
@@ -635,6 +635,8 @@
/**
* @dataProvider somethingProvider
+ * @param array $actions
+ * @param array $expectedEvents
*/
public function testSomething( array $actions, array $expectedEvents ) {
$logPosition = $this->getEventLogPosition();
@@ -789,6 +791,7 @@
/**
* Shown when the original search query was run, but the
* search engine has a suggestion for a better query
+ * @return function
*/
protected function clickDidYouMeanSuggestion() {
return function ( $webDriver ) {
@@ -802,7 +805,8 @@
* Shown when the rewritten search query was run. Gives
* the user a direct link to this search, which might show
* a new did you mean.
- */
+ * @return function
+ */
protected function clickDidYouMeanRewritten() {
return function ( $webDriver ) {
$webDriver->findElement( WebDriverBy::cssSelector(
@@ -815,7 +819,8 @@
* Shown when the rewritten search query was run. Gives
* the user a direct link to the original search without
* it being rewritten.
- */
+ * @return function
+ */
protected function clickDidYouMeanOriginal() {
return function ( $webDriver ) {
$webDriver->findElement( WebDriverBy::cssSelector(
@@ -995,6 +1000,8 @@
/**
* Helper function to perform ctrl-click (open in new tab/window)
+ * @param WebDriver $webDriver
+ * @param string $webDriverBy
*/
protected static function ctrlClick( $webDriver, $webDriverBy ) {
$webDriver->action()
@@ -1011,6 +1018,8 @@
/**
* Supports advanced css selector syntax that selenium can't
* such as attribute selection
+ * @param string $selector
+ * @return string
*/
protected static function byExtendedCss( $selector ) {
static $conv;
--
To view, visit https://gerrit.wikimedia.org/r/371009
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5bd8954790c38084ae6e6e38927dcb30772533b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits