Yurik has uploaded a new change for review.
https://gerrit.wikimedia.org/r/53132
Change subject: Annotate few cases with static analysis attributes
......................................................................
Annotate few cases with static analysis attributes
PhpStorm IDE has a very good static analysis tools that helped me
find a number of issues with the code. To make it more useful,
several false positives need to be explicitly declared as ok.
Change-Id: I9668f1a49998f589c48d7a1284ac487f3172bf76
---
M includes/api/ApiBase.php
M includes/api/ApiEditPage.php
2 files changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/32/53132/1
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index 3577193..d921b10 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -334,6 +334,7 @@
/**
* @param $item string
* @return string
+ * @noinspection PhpUnusedPrivateMethodInspection
*/
private function indentExampleText( $item ) {
return " " . $item;
@@ -799,6 +800,7 @@
*
* @param $x object Parameter to check is not null/false
* @return bool
+ * @noinspection PhpUnusedPrivateMethodInspection
*/
private function parameterNotEmpty( $x ) {
return !is_null( $x ) && $x !== false;
diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php
index dc449b8..237d7f2 100644
--- a/includes/api/ApiEditPage.php
+++ b/includes/api/ApiEditPage.php
@@ -391,6 +391,7 @@
case EditPage::AS_TEXTBOX_EMPTY:
$this->dieUsageMsg( 'emptynewsection' );
+ /** @noinspection PhpMissingBreakStatementInspection */
case EditPage::AS_SUCCESS_NEW_ARTICLE:
$r['new'] = '';
--
To view, visit https://gerrit.wikimedia.org/r/53132
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9668f1a49998f589c48d7a1284ac487f3172bf76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Yurik <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits