jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: Various small cleanups
......................................................................


Hygiene: Various small cleanups

* Add some missing properties to Pager
* Remove unused Pager::getDefaultDirection and Pager::{g,s}etDefaultLimit 
methods
* Correct the return phpdoc on Index::getSort to match implementation
* Fix incorrect or partial docblock in many classes
* Remove unused class alias's in a few files
* Add missing class alias's in a few files
* Other minor cleanups from scripts/analyze-phpstorm.sh

Change-Id: I54a813b9ad1a0a5c9aa1abfb527184d9745b4794
---
M Flow.php
M includes/Actions/Action.php
M includes/Block/BoardHistory.php
M includes/Block/Header.php
M includes/Block/Topic.php
M includes/Block/TopicList.php
M includes/Content/BoardContent.php
M includes/Content/BoardContentHandler.php
M includes/Content/Content.php
M includes/Data/BoardHistoryIndex.php
M includes/Data/HeaderRecentChanges.php
M includes/Data/Index.php
M includes/Data/NotificationListener.php
M includes/Data/Pager.php
M includes/Data/PostRevisionRecentChanges.php
M includes/Data/PostSummaryRecentChanges.php
M includes/Data/ReferenceRecorder.php
M includes/Data/TopicHistoryIndex.php
M includes/Data/TopicHistoryStorage.php
M includes/Data/WatchTopicListener.php
M includes/Formatter/AbstractFormatter.php
M includes/Formatter/AbstractQuery.php
M includes/Formatter/CheckUserFormatter.php
M includes/Formatter/CheckUserQuery.php
M includes/Formatter/PostHistoryQuery.php
M includes/Formatter/RevisionFormatter.php
M includes/Formatter/RevisionViewFormatter.php
M includes/Formatter/RevisionViewQuery.php
M includes/Formatter/TopicFormatter.php
M includes/Formatter/TopicListFormatter.php
M includes/Formatter/TopicListQuery.php
M includes/Formatter/TopicRow.php
M includes/LinksTableUpdater.php
M includes/Log/Logger.php
M includes/Log/PostModerationLogger.php
M includes/Model/AbstractRevision.php
M includes/Model/Workflow.php
M includes/Notifications/Controller.php
M includes/Notifications/Formatter.php
M includes/Notifications/UserLocator.php
M includes/Parsoid/BadImageRemover.php
M includes/Parsoid/ReferenceExtractor.php
M includes/ReferenceClarifier.php
M includes/Repository/TreeRepository.php
M includes/SubmissionHandler.php
M includes/TemplateHelper.php
M includes/UrlGenerator.php
M includes/View.php
M includes/WorkflowLoader.php
49 files changed, 224 insertions(+), 104 deletions(-)

Approvals:
  Matthias Mullie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Flow.php b/Flow.php
index 5b2d56c..f0387e6 100755
--- a/Flow.php
+++ b/Flow.php
@@ -131,8 +131,6 @@
        $dir . "modules/new/styles/flow.less/",
 ) );
 
-$wgJobClasses['Flow\Jobs\WatchTitle'] = 'Flow\Jobs\WatchTitle';
-
 // Configuration
 
 // URL for more information about the Flow notification system
diff --git a/includes/Actions/Action.php b/includes/Actions/Action.php
index 421f6cc..9ed52af 100644
--- a/includes/Actions/Action.php
+++ b/includes/Actions/Action.php
@@ -10,11 +10,9 @@
 use Flow\Exception\InvalidInputException;
 use Flow\Model\UUID;
 use Flow\View;
-use DerivativeContext;
 use IContextSource;
 use OutputPage;
 use Page;
-use RequestContext;
 use Title;
 use WebRequest;
 use WikiPage;
@@ -38,7 +36,8 @@
        /**
         * @param string $action
         * @param OutputPage|null $output
-        * @return
+        * @throws ErrorPageError
+        * @throws FlowException
         */
        public function showForAction( $action, OutputPage $output = null ) {
                $container = Container::getContainer();
diff --git a/includes/Block/BoardHistory.php b/includes/Block/BoardHistory.php
index d0fb24a..7986d11 100644
--- a/includes/Block/BoardHistory.php
+++ b/includes/Block/BoardHistory.php
@@ -4,7 +4,6 @@
 
 use Flow\RevisionActionPermissions;
 use Flow\Container;
-use Flow\Templating;
 use Flow\Exception\DataModelException;
 
 class BoardHistoryBlock extends AbstractBlock {
diff --git a/includes/Block/Header.php b/includes/Block/Header.php
index 51f899b..a9da091 100644
--- a/includes/Block/Header.php
+++ b/includes/Block/Header.php
@@ -8,7 +8,6 @@
 use Flow\Formatter\FormatterRow;
 use Flow\Model\Header;
 use Flow\RevisionActionPermissions;
-use Flow\Templating;
 
 class HeaderBlock extends AbstractBlock {
 
diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php
index fe104d7..ff0e16f 100644
--- a/includes/Block/Topic.php
+++ b/includes/Block/Topic.php
@@ -16,7 +16,6 @@
 use Flow\Model\PostRevision;
 use Flow\Model\UUID;
 use Flow\Model\Workflow;
-use Flow\NotificationController;
 use Flow\Parsoid\Utils;
 use Flow\RevisionActionPermissions;
 use Flow\Templating;
@@ -651,8 +650,10 @@
 
        /**
         * Process the history result for either topic or post
-        * @param FormatterRow
-        * @param array
+        *
+        * @param FormatterRow $found
+        * @param array $options
+        * @return array
         */
        protected function processHistoryResult( $found, $options ) {
                $serializer = $this->getRevisionFormatter();
@@ -699,6 +700,7 @@
        /**
         * @param string $action Permissions action to require to return 
revision
         * @return AbstractRevision|null
+        * @throws InvalidDataException
         */
        public function loadTopicTitle( $action = 'view' ) {
                if ( $this->workflow->isNew() ) {
@@ -791,6 +793,7 @@
        /**
         * @param Templating $templating
         * @param \OutputPage $out
+        * @throws PermissionException
         *
         * @todo Provide more informative page title for actions other than 
view,
      *       e.g. "Hide post in <TITLE>", "Unlock <TITLE>", etc.
diff --git a/includes/Block/TopicList.php b/includes/Block/TopicList.php
index d707094..8733071 100644
--- a/includes/Block/TopicList.php
+++ b/includes/Block/TopicList.php
@@ -3,7 +3,6 @@
 namespace Flow\Block;
 
 use Flow\Container;
-use Flow\Data\ManagerGroup;
 use Flow\Data\Pager;
 use Flow\Data\PagerPage;
 use Flow\Model\PostRevision;
@@ -303,7 +302,8 @@
        public function setPageTitle( Templating $templating, \OutputPage $out 
) {
                if ( $this->action !== 'new-topic' ) {
                        // Only new-topic should override page title, rest 
should default
-                       return parent::setPageTitle( $templating, $out );
+                       parent::setPageTitle( $templating, $out );
+                       return;
                }
 
                $title = $this->workflow->getOwnerTitle();
diff --git a/includes/Content/BoardContent.php 
b/includes/Content/BoardContent.php
index 7d85e94..e9ebece 100644
--- a/includes/Content/BoardContent.php
+++ b/includes/Content/BoardContent.php
@@ -8,6 +8,7 @@
 use Flow\Model\UUID;
 use Flow\Model\Workflow;
 use Flow\View;
+use Flow\WorkflowLoader;
 use MWException;
 use OutputPage;
 use ParserOptions;
@@ -190,6 +191,7 @@
                        );
 
                        // Load workflow and run View.
+                       /** @var WorkflowLoader $loader */
                        $loader = Container::get('factory.loader.workflow')
                                ->createWorkflowLoader( $title, 
$this->getWorkflowId() );
                        $view->show( $loader, 'view' );
diff --git a/includes/Content/BoardContentHandler.php 
b/includes/Content/BoardContentHandler.php
index fcbed5c..d706e1e 100644
--- a/includes/Content/BoardContentHandler.php
+++ b/includes/Content/BoardContentHandler.php
@@ -3,6 +3,7 @@
 namespace Flow\Content;
 
 use Flow\Container;
+use Flow\FlowActions;
 use Flow\Model\UUID;
 use FormatJson;
 use MWException;
@@ -31,10 +32,10 @@
         *
         * @since 1.21
         *
-        * @param Content $content The Content object to serialize
-        * @param string $format The desired serialization format
-        *
+        * @param \Content $content The Content object to serialize
+        * @param string|null $format The desired serialization format
         * @return string Serialized form of the content
+        * @throws MWException
         */
        public function serializeContent( \Content $content, $format = null ) {
                if ( ! $content instanceof BoardContent ) {
@@ -113,6 +114,7 @@
         */
        public function getActionOverrides() {
                $container = Container::getContainer();
+               /** @var FlowActions $actions */
                $actions = $container['flow_actions'];
                $output = array();
 
diff --git a/includes/Content/Content.php b/includes/Content/Content.php
index c2475be..236c441 100644
--- a/includes/Content/Content.php
+++ b/includes/Content/Content.php
@@ -3,6 +3,7 @@
 namespace Flow\Content;
 
 use Flow\Exception\FlowException;
+use Flow\WorkflowLoader;
 use Article;
 use ContentHandler;
 use Flow\Container;
@@ -48,6 +49,7 @@
                $title = $article->getTitle();
 
                if ( $occupationController->isTalkpageOccupied( $title ) ) {
+                       /** @var WorkflowLoader $loader */
                        $loader = Container::get('factory.loader.workflow')
                                ->createWorkflowLoader( $title );
 
diff --git a/includes/Data/BoardHistoryIndex.php 
b/includes/Data/BoardHistoryIndex.php
index 5391285..f3f0cbb 100644
--- a/includes/Data/BoardHistoryIndex.php
+++ b/includes/Data/BoardHistoryIndex.php
@@ -42,6 +42,7 @@
        /**
         * @param Header|PostRevision $object
         * @param string[] $new
+        * @param array $metadata
         */
        public function onAfterInsert( $object, array $new, array $metadata ) {
                if ( $object instanceof Header ) {
@@ -65,6 +66,7 @@
         * @param Header|PostRevision $object
         * @param string[] $old
         * @param string[] $new
+        * @param array $metadata
         */
        public function onAfterUpdate( $object, array $old, array $new, array 
$metadata ) {
                if ( $object instanceof Header ) {
@@ -87,6 +89,7 @@
        /**
         * @param Header|PostRevision $object
         * @param string[] $old
+        * @param array $metadata
         */
        public function onAfterRemove( $object, array $old, array $metadata ) {
                if ( $object instanceof Header ) {
@@ -107,14 +110,14 @@
         * @param PostRevision $object
         * @return string|boolean False when object is not root post or topic 
is not found
         */
-       protected function findTopicListId( $object ) {
+       protected function findTopicListId( PostRevision $object ) {
                $found = Container::get( 'storage' )->find(
                        'TopicListEntry',
                        array( 'topic_id' => 
$object->getRootPost()->getPostId() )
                );
 
                if ( $found ) {
-                       /** @var TopicListEntry $var */
+                       /** @var TopicListEntry $topicListEntry */
                        $topicListEntry = reset( $found );
                        return $topicListEntry->getListId()->getAlphadecimal();
                } else {
diff --git a/includes/Data/HeaderRecentChanges.php 
b/includes/Data/HeaderRecentChanges.php
index aa3712f..4bd23bf 100644
--- a/includes/Data/HeaderRecentChanges.php
+++ b/includes/Data/HeaderRecentChanges.php
@@ -25,6 +25,8 @@
        /**
         * @param Header $object
         * @param string[] $row
+        * @param array $metadata
+        * @throws FlowException
         */
        public function onAfterInsert( $object, array $row, array $metadata ) {
                if ( !isset( $metadata['workflow'] ) ) {
diff --git a/includes/Data/Index.php b/includes/Data/Index.php
index 5d172d7..439cb0d 100644
--- a/includes/Data/Index.php
+++ b/includes/Data/Index.php
@@ -57,7 +57,7 @@
        function getLimit();
 
        /**
-        * @return string Sorting order, either 'ASC' or 'DESC'
+        * @return array|false Sorting order, either 'ASC' or 'DESC'
         */
        function getSort();
 
diff --git a/includes/Data/NotificationListener.php 
b/includes/Data/NotificationListener.php
index 6e98248..665f002 100644
--- a/includes/Data/NotificationListener.php
+++ b/includes/Data/NotificationListener.php
@@ -2,9 +2,10 @@
 
 namespace Flow\Data;
 
+use Flow\Exception\InvalidDataException;
 use Flow\Model\AbstractRevision;
+use Flow\Model\Workflow;
 use Flow\NotificationController;
-use User;
 
 class NotificationListener implements LifecycleHandler {
 
@@ -52,10 +53,14 @@
        }
 
        protected function notifyPostChange( $type, $object, $metadata, array 
$params = array() ) {
+               $workflow = $metadata['workflow'];
+               if ( !$workflow instanceof Workflow ) {
+                       throw new InvalidDataException( 'Workflow metadata is 
not a Workflow' );
+               }
                $this->notificationController->notifyPostChange( $type, $params 
+ array(
                        'revision' => $object,
-                       'title' => $metadata['workflow']->getOwnerTitle(),
-                       'topic-workflow' => $metadata['workflow'],
+                       'title' => $workflow->getOwnerTitle(),
+                       'topic-workflow' => $workflow,
                        'topic-title' => $metadata['topic-title'],
                ) );
        }
diff --git a/includes/Data/Pager.php b/includes/Data/Pager.php
index 11dce11..b00cb6a 100644
--- a/includes/Data/Pager.php
+++ b/includes/Data/Pager.php
@@ -8,6 +8,8 @@
  * Fetches paginated results from the OM provided in constructor
  */
 class Pager {
+       const DEFAULT_LIMIT = 1;
+
        /**
         * @var ObjectManager
         */
@@ -19,9 +21,19 @@
        protected $index;
 
        /**
-        * @var integer
+        * @var array Results sorted by the values in this array
         */
-       protected $defaultLimit = 5;
+       protected $sort;
+
+       /**
+        * @var array Map of column name to column value for equality query
+        */
+       protected $query;
+
+       /**
+        * @var array Options effecting the result such as `sort`, `order`, and 
`pager-limit`
+        */
+       protected $options;
 
        public function __construct( ObjectManager $storage, array $query, 
array $options ) {
                // not sure i like this
@@ -66,27 +78,6 @@
                } else {
                        return $this->processPage( $direction, $offset, 
$pageLimit, $results );
                }
-       }
-
-       /**
-        * @return integer
-        */
-       public function getDefaultLimit() {
-               return $this->defaultLimit;
-       }
-
-       /**
-        * @param integer $newLimit
-        */
-       public function setDefaultLimit( $newLimit ) {
-               $this->defaultLimit = $newLimit;
-       }
-
-       /**
-        * @return string
-        */
-       protected function getDefaultDirection() {
-               return 'fwd';
        }
 
        /**
@@ -216,7 +207,7 @@
                        }
                }
 
-               return $this->getDefaultLimit();
+               return self::DEFAULT_LIMIT;
        }
 
        /**
diff --git a/includes/Data/PostRevisionRecentChanges.php 
b/includes/Data/PostRevisionRecentChanges.php
index df29b97..3238e50 100644
--- a/includes/Data/PostRevisionRecentChanges.php
+++ b/includes/Data/PostRevisionRecentChanges.php
@@ -24,6 +24,8 @@
        /**
         * @param PostRevision $object
         * @param string[] $row
+        * @param array $metadata
+        * @throws FlowException
         */
        public function onAfterInsert( $object, array $row, array $metadata ) {
                if ( !isset( $metadata['workflow'] ) ) {
diff --git a/includes/Data/PostSummaryRecentChanges.php 
b/includes/Data/PostSummaryRecentChanges.php
index 962a745..9cc4115 100644
--- a/includes/Data/PostSummaryRecentChanges.php
+++ b/includes/Data/PostSummaryRecentChanges.php
@@ -24,6 +24,8 @@
        /**
         * @param PostSummary $object
         * @param string[] $row
+        * @param array $metadata
+        * @throws FlowException
         */
        public function onAfterInsert( $object, array $row, array $metadata ) {
                if ( !isset( $metadata['workflow'] ) ) {
diff --git a/includes/Data/ReferenceRecorder.php 
b/includes/Data/ReferenceRecorder.php
index e83113f..887d3b4 100644
--- a/includes/Data/ReferenceRecorder.php
+++ b/includes/Data/ReferenceRecorder.php
@@ -14,7 +14,20 @@
  * revision. Uses calculated difference to update links tables to match the 
new revision.
  */
 class ReferenceRecorder implements LifecycleHandler {
-       protected $referenceExtractor, $storage, $linksTableUpdater;
+       /**
+        * @var ReferenceExtractor
+        */
+       protected $referenceExtractor;
+
+       /**
+        * @var MangerGroup
+        */
+       protected $storage;
+
+       /**
+        * @var LinksTableUpdater
+        */
+       protected $linksTableUpdater;
 
        public function __construct( ReferenceExtractor $referenceExtractor, 
LinksTableUpdater $linksTableUpdater, ManagerGroup $storage ) {
                $this->referenceExtractor = $referenceExtractor;
@@ -30,10 +43,13 @@
                if ( !isset( $metadata['workflow'] )) {
                        return;
                }
+               if ( !$revision instanceof AbstractRevision ) {
+                       throw new InvalidDataException( 'ReferenceRecorder can 
only attach to AbstractRevision storage');
+               }
                $workflow = $metadata['workflow'];
 
                // Topic title is plain text, there is no reference to extract
-               if ( $revision->getRevisionType() === 'post' && 
$revision->isTopicTitle() ) {
+               if ( $revision instanceof PostRevision && 
$revision->isTopicTitle() ) {
                        return;
                }
 
@@ -51,7 +67,8 @@
 
        /**
         * Pulls references from a revision's content
-        * @param  Workflow         $workflow The Workflow that the revision is 
attached to.
+        *
+        * @param  Workflow $workflow The Workflow that the revision is 
attached to.
         * @param  AbstractRevision $revision The Revision to pull references 
from.
         * @return array Array of References.
         */
@@ -68,9 +85,10 @@
 
        /**
         * Retrieves references that are already stored in the database for a 
given revision
+        *
         * @param  string $revType The value returned from 
Revision::getRevisionType() for the revision.
-        * @param  UUID   $objectId   The revision's Object ID.
-        * @return array           Array of References.
+        * @param  UUID $objectId   The revision's Object ID.
+        * @return array Array of References.
         */
        public function getExistingReferences( $revType, UUID $objectId ) {
                $prevWikiReferences = $this->storage->find( 'WikiReference', 
array(
@@ -90,9 +108,10 @@
         * Compares two arrays of references
         *
         * Would be protected if not for testing.
-        * @param  array  $old The old references.
-        * @param  array  $new The new references.
-        * @return array       Array with two elements: added and removed 
references.
+        *
+        * @param  Reference[] $old The old references.
+        * @param  Reference[] $new The new references.
+        * @return array Array with two elements: added and removed references.
         */
        public function referencesDifference( array $old, array $new ) {
                $newReferences = array();
diff --git a/includes/Data/TopicHistoryIndex.php 
b/includes/Data/TopicHistoryIndex.php
index b4ff7cb..3e0facc 100644
--- a/includes/Data/TopicHistoryIndex.php
+++ b/includes/Data/TopicHistoryIndex.php
@@ -26,6 +26,7 @@
        /**
         * @param PostRevision $object
         * @param string[] $new
+        * @param array $metadata
         */
        public function onAfterInsert( $object, array $new, array $metadata ) {
                if ( $object instanceof PostRevision ) {
@@ -41,6 +42,7 @@
         * @param PostRevision $object
         * @param string[] $old
         * @param string[] $new
+        * @param array $metadata
         */
        public function onAfterUpdate( $object, array $old, array $new, array 
$metadata ) {
                if ( $object instanceof PostRevision ) {
@@ -55,6 +57,7 @@
        /**
         * @param PostRevision $object
         * @param string[] $old
+        * @param array $metadata
         */
        public function onAfterRemove( $object, array $old, array $metadata ) {
                if ( $object instanceof PostRevision ) {
diff --git a/includes/Data/TopicHistoryStorage.php 
b/includes/Data/TopicHistoryStorage.php
index 37bdbfb..12a8b1c 100644
--- a/includes/Data/TopicHistoryStorage.php
+++ b/includes/Data/TopicHistoryStorage.php
@@ -11,11 +11,21 @@
  */
 class TopicHistoryStorage implements ObjectStorage {
 
+       /**
+        * @var ObjectStorage
+        */
        protected $postRevisionStorage;
 
+       /**
+        * @var ObjectStorage
+        */
        protected $postSummaryStorage;
 
-       public function __construct( $postRevisionStorage, $postSummaryStorage 
) {
+       /**
+        * @param ObjectStorage $postRevisionStorage
+        * @param ObjectStorage $postSummaryStorage
+        */
+       public function __construct( ObjectStorage $postRevisionStorage, 
ObjectStorage $postSummaryStorage ) {
                $this->postRevisionStorage = $postRevisionStorage;
                $this->postSummaryStorage = $postSummaryStorage;
        }
@@ -73,5 +83,4 @@
        public function getIterator() {
                throw new DataModelException( 'Not Implemented', 'process-data' 
);
        }
-
 }
diff --git a/includes/Data/WatchTopicListener.php 
b/includes/Data/WatchTopicListener.php
index 02bc7b3..212fe87 100644
--- a/includes/Data/WatchTopicListener.php
+++ b/includes/Data/WatchTopicListener.php
@@ -3,12 +3,11 @@
 namespace Flow\Data;
 
 use Flow\Container;
+use Flow\Exception\InvalidDataException;
 use Flow\FlowActions;
-use Flow\Jobs\WatchTitle;
 use Flow\Model\PostRevision;
 use Flow\Model\Workflow;
 use Flow\WatchedTopicItems;
-use JobQueueGroup;
 use Title;
 use User;
 use WatchedItem;
@@ -34,14 +33,18 @@
                        wfWarn( __METHOD__ . ': Missing required metadata: 
workflow' );
                        return;
                }
+               $workflow = $metadata['workflow'];
+               if ( !$workflow instanceof Workflow ) {
+                       throw new InvalidDataException( 'Workflow metadata is 
not Workflow instance' );
+               }
 
-               if ( $metadata['workflow']->getType() !== 'topic' ) {
-                       wfWarn( __METHOD__ . ': Expected "topic" workflow but 
received "' . $metadata['workflow']->getType() . '"' );
+               if ( $workflow->getType() !== 'topic' ) {
+                       wfWarn( __METHOD__ . ': Expected "topic" workflow but 
received "' . $workflow->getType() . '"' );
                        return;
                }
 
                /** @var $title Title */
-               $title = $metadata['workflow']->getArticleTitle();
+               $title = $workflow->getArticleTitle();
                if ( !$title ) {
                        return;
                }
@@ -55,7 +58,7 @@
         * @param string $changeType
         * @param string $watchType Key of the corresponding 'watch' array in 
FlowActions.php
         * @param array $params Params to feed to callback function that will 
return
-        *                      an array of users to subscribe
+        *   an array of users to subscribe
         * @return User[]
         */
        public static function getUsersToSubscribe( $changeType, $watchType, 
array $params = array() ) {
@@ -128,4 +131,3 @@
                return array( $watchedTopicItems->getUser() );
        }
 }
-
diff --git a/includes/Formatter/AbstractFormatter.php 
b/includes/Formatter/AbstractFormatter.php
index daec5c7..ec33b0a 100644
--- a/includes/Formatter/AbstractFormatter.php
+++ b/includes/Formatter/AbstractFormatter.php
@@ -288,7 +288,7 @@
                if ( !isset( $data['links']['topic'] ) || !$row->revision 
instanceof PostRevision ) {
                        return $ownerLink;
                }
-               /** @var \Flow\Anchor $topic */
+               /** @var Anchor $topic */
                $topic = $data['links']['topic'];
 
                // generated link has generic link text, should be actual topic 
title
diff --git a/includes/Formatter/AbstractQuery.php 
b/includes/Formatter/AbstractQuery.php
index 01c6829..8c10575 100644
--- a/includes/Formatter/AbstractQuery.php
+++ b/includes/Formatter/AbstractQuery.php
@@ -53,7 +53,7 @@
        /**
         * Array of collection ids mapping to their most recent revision ids.
         *
-        * @var array
+        * @var UUID[]
         */
        protected $currentRevisionsCache = array();
 
@@ -156,14 +156,14 @@
                                $queries[] = array( 'rev_type_id' => $uuid );
                        }
 
-                       /** @var AbstractRevision[][] $found */
                        $found = $this->storage->findMulti( $revisionType,
                                $queries,
                                array( 'sort' => 'rev_id', 'order' => 'DESC', 
'limit' => 1 )
                        );
 
-                       foreach ( $found as $rev ) {
-                               $rev = reset( $rev );
+                       /** @var AbstractRevision[] $result */
+                       foreach ( $found as $result ) {
+                               $rev = reset( $result );
                                
$this->currentRevisionsCache[$rev->getCollectionId()->getAlphadecimal()] = 
$rev->getRevisionId();
                                
$revisions[$rev->getRevisionId()->getAlphadecimal()] = $rev;
                        }
diff --git a/includes/Formatter/CheckUserFormatter.php 
b/includes/Formatter/CheckUserFormatter.php
index d46816f..c38197a 100644
--- a/includes/Formatter/CheckUserFormatter.php
+++ b/includes/Formatter/CheckUserFormatter.php
@@ -33,7 +33,7 @@
                $links = $this->serializer->buildLinks( $row );
                $properties = $this->serializer->buildProperties( 
$row->workflow->getId(), $row->revision, $ctx );
                if ( $links === null ) {
-                       wfDebugLog( 'Flow', __METHOD__ . ': No links were 
generated for revision ' . $row->revision->getAlphadecimal() );
+                       wfDebugLog( 'Flow', __METHOD__ . ': No links were 
generated for revision ' . $row->revision->getRevisionId()->getAlphadecimal() );
                        return null;
                }
 
diff --git a/includes/Formatter/CheckUserQuery.php 
b/includes/Formatter/CheckUserQuery.php
index 147e5df..e52c9c2 100644
--- a/includes/Formatter/CheckUserQuery.php
+++ b/includes/Formatter/CheckUserQuery.php
@@ -101,7 +101,7 @@
         * format.
         *
         * @param \StdClass $row
-        * @return array|false Array with workflow, revision & post id (when
+        * @return UUID[]|false Array with workflow, revision & post id (when
         *  applicable), or false on error
         */
        protected function extractIds( $row ) {
diff --git a/includes/Formatter/PostHistoryQuery.php 
b/includes/Formatter/PostHistoryQuery.php
index b7543b5..d27547a 100644
--- a/includes/Formatter/PostHistoryQuery.php
+++ b/includes/Formatter/PostHistoryQuery.php
@@ -2,6 +2,8 @@
 
 namespace Flow\Formatter;
 
+use Flow\Exception\FlowException;
+use Flow\Exception\InvalidDataException;
 use Flow\Model\UUID;
 
 class PostHistoryQuery extends AbstractQuery {
diff --git a/includes/Formatter/RevisionFormatter.php 
b/includes/Formatter/RevisionFormatter.php
index 31335b5..75d4294 100644
--- a/includes/Formatter/RevisionFormatter.php
+++ b/includes/Formatter/RevisionFormatter.php
@@ -255,7 +255,7 @@
        }
 
        /**
-        * @param array $user Contains `name`, `wiki`, and `gender` keys
+        * @param array $userData Contains `name`, `wiki`, and `gender` keys
         * @return array
         */
        public function serializeUserLinks( $userData ) {
diff --git a/includes/Formatter/RevisionViewFormatter.php 
b/includes/Formatter/RevisionViewFormatter.php
index 551a662..1218d68 100644
--- a/includes/Formatter/RevisionViewFormatter.php
+++ b/includes/Formatter/RevisionViewFormatter.php
@@ -21,7 +21,7 @@
        }
 
        /**
-        * @param FormatterRow $row
+        * @param RevisionViewRow $row
         * @param IContextSource $ctx
         * @return array
         */
@@ -130,7 +130,7 @@
        /**
         * Diff would format against two revisions
         */
-       public function formatApi( FormatterRow $newRow, FormatterRow $oldRow, 
IContextSource $ctx ) {
+       public function formatApi( RevisionViewRow $newRow, RevisionViewRow 
$oldRow, IContextSource $ctx ) {
                $oldRes = $this->revisionViewFormatter->formatApi( $oldRow, 
$ctx );
                $newRes = $this->revisionViewFormatter->formatApi( $newRow, 
$ctx );
 
diff --git a/includes/Formatter/RevisionViewQuery.php 
b/includes/Formatter/RevisionViewQuery.php
index 1486d36..07f56c1 100644
--- a/includes/Formatter/RevisionViewQuery.php
+++ b/includes/Formatter/RevisionViewQuery.php
@@ -7,6 +7,7 @@
 use Flow\Exception\PermissionException;
 use Flow\Model\AbstractRevision;
 use Flow\Model\UUID;
+use Flow\RevisionActionPermissions;
 
 abstract class RevisionViewQuery extends AbstractQuery {
 
@@ -51,9 +52,8 @@
 
        /**
         * Get the data for rendering revisions diff view
-        * @param string
-        * @param UUID
-        * @param UUID
+        * @param UUID $curId
+        * @param UUID|null $prevId
         * @return RevisionViewRow
         * @throws InvalidInputException
         * @throws PermissionException
@@ -86,6 +86,7 @@
                        $newRev = $prev;
                }
 
+               /** @var RevisionActionPermissions $permission */
                $permission = Container::get( 'permissions' );
                // Todo - Check the permission before invoking this function?
                if ( !$permission->isAllowed( $oldRev, 'view' ) || 
!$permission->isAllowed( $newRev, 'view' ) ) {
diff --git a/includes/Formatter/TopicFormatter.php 
b/includes/Formatter/TopicFormatter.php
index a67d824..da910f3 100644
--- a/includes/Formatter/TopicFormatter.php
+++ b/includes/Formatter/TopicFormatter.php
@@ -27,8 +27,6 @@
                        'revisions' => array(),
                        'links' => array(),
                        'actions' => $this->buildApiActions( $workflow ),
-                       // @todo feels like a middleware type thing should just 
inject this,
-                       //'editToken' => $this->getEditToken(),
                );
        }
 
diff --git a/includes/Formatter/TopicListFormatter.php 
b/includes/Formatter/TopicListFormatter.php
index 67a2c21..23fe460 100644
--- a/includes/Formatter/TopicListFormatter.php
+++ b/includes/Formatter/TopicListFormatter.php
@@ -75,6 +75,13 @@
                return $res;
        }
 
+       /**
+        * @param Workflow $listWorkflow
+        * @param Workflow[] $workflows
+        * @param FormatterRow[] $found
+        * @param IContextSource $ctx
+        * @return array
+        */
        protected function buildResult( Workflow $listWorkflow, array 
$workflows, array $found, IContextSource $ctx ) {
                $revisions = $posts = $replies = array();
                foreach( $found as $formatterRow ) {
@@ -159,6 +166,7 @@
                        }
                } while( !$stack->isEmpty() );
 
+               /** @var Workflow|null $workflow */
                $workflow = isset( $workflows[$postAlphaId] ) ? 
$workflows[$postAlphaId] : null;
                $ts = $workflow ? 
$workflow->getLastModifiedObj()->getTimestamp() : 0;
                return array(
diff --git a/includes/Formatter/TopicListQuery.php 
b/includes/Formatter/TopicListQuery.php
index 108303a..49f4658 100644
--- a/includes/Formatter/TopicListQuery.php
+++ b/includes/Formatter/TopicListQuery.php
@@ -23,6 +23,7 @@
         * @param ManagerGroup $storage
         * @param TreeRepository $treeRepository
         * @param RevisionActionPermissions $permissions
+        * @param WatchedTopicItems $watchedTopicItems
         */
        public function __construct( ManagerGroup $storage, TreeRepository 
$treeRepository, RevisionActionPermissions $permissions, WatchedTopicItems 
$watchedTopicItems ) {
                parent::__construct( $storage, $treeRepository );
@@ -133,7 +134,7 @@
 
                // re-index by alphadecimal id
                return array_combine(
-                       array_map( function( $x ) { return 
$x->getAlphadecimal(); }, $postIds ),
+                       array_map( function( UUID $x ) { return 
$x->getAlphadecimal(); }, $postIds ),
                        $postIds
                );
        }
diff --git a/includes/Formatter/TopicRow.php b/includes/Formatter/TopicRow.php
index b5542f5..122ee62 100644
--- a/includes/Formatter/TopicRow.php
+++ b/includes/Formatter/TopicRow.php
@@ -2,8 +2,22 @@
 
 namespace Flow\Formatter;
 
+use Flow\Model\PostRevision;
+use Flow\Model\PostSummary;
+
 class TopicRow extends FormatterRow {
+       /**
+        * @var PostRevision[]
+        */
        public $replies;
+
+       /**
+        * @var PostSummary
+        */
        public $summary;
+
+       /**
+        * @var bool
+        */
        public $isWatched;
 }
diff --git a/includes/LinksTableUpdater.php b/includes/LinksTableUpdater.php
index 89330e9..2f6739e 100644
--- a/includes/LinksTableUpdater.php
+++ b/includes/LinksTableUpdater.php
@@ -4,8 +4,10 @@
 
 use DataUpdate;
 use Flow\Data\ManagerGroup;
+use Flow\Model\Reference;
 use Flow\Model\URLReference;
 use Flow\Model\WikiReference;
+use Flow\Model\Workflow;
 use LinkBatch;
 use LinkCache;
 use ParserOutput;
@@ -24,7 +26,7 @@
                $this->storage = $storage;
        }
 
-       public function doUpdate( $workflow ) {
+       public function doUpdate( Workflow $workflow ) {
                $title = $workflow->getArticleTitle();
                $page = WikiPage::factory( $title );
                $content = $page->getContent();
@@ -37,13 +39,20 @@
                DataUpdate::runUpdates( $updates );
        }
 
+       /**
+        * @param Title $title
+        * @param ParserOutput $parserOutput
+        * @param Reference[]|bool $references
+        */
        public function mutateParserOutput( Title $title, ParserOutput 
$parserOutput, $references = false ) {
                if ( $references === false ) {
                        $references = $this->getReferencesForTitle( $title );
                }
 
                $linkBatch = new LinkBatch();
+               /** @var Title[] $internalLinks */
                $internalLinks = array();
+               /** @var Title[] $templates */
                $templates = array();
 
                foreach( $references as $reference ) {
@@ -93,7 +102,7 @@
                }
        }
 
-       public function getReferencesForTitle( $title ) {
+       public function getReferencesForTitle( Title $title ) {
                $wikiReferences = $this->storage->find(
                        'WikiReference',
                        array(
diff --git a/includes/Log/Logger.php b/includes/Log/Logger.php
index 88eb67e..26df085 100644
--- a/includes/Log/Logger.php
+++ b/includes/Log/Logger.php
@@ -7,6 +7,7 @@
 use Flow\FlowActions;
 use Flow\Model\PostRevision;
 use Flow\Model\UUID;
+use Flow\Model\Workflow;
 use ManualLogEntry;
 use Title;
 use User;
@@ -64,6 +65,7 @@
                $logType = $this->getLogType( $post, $action );
 
                // reasonably likely this is already loaded in-process and just 
returns that object
+               /** @var Workflow $workflow */
                $workflow = Container::get( 'storage.workflow' )->get( 
$workflowId );
                if ( $workflow ) {
                        $title = $workflow->getArticleTitle();
diff --git a/includes/Log/PostModerationLogger.php 
b/includes/Log/PostModerationLogger.php
index 20b1c51..494202e 100644
--- a/includes/Log/PostModerationLogger.php
+++ b/includes/Log/PostModerationLogger.php
@@ -20,6 +20,7 @@
        /**
         * @param PostRevision $object
         * @param array $row
+        * @param array $metadata
         */
        function onAfterInsert( $object, array $row, array $metadata ) {
                if ( $object instanceof PostRevision ) {
diff --git a/includes/Model/AbstractRevision.php 
b/includes/Model/AbstractRevision.php
index 2ea779c..aebad5b 100644
--- a/includes/Model/AbstractRevision.php
+++ b/includes/Model/AbstractRevision.php
@@ -3,7 +3,9 @@
 namespace Flow\Model;
 
 use Flow\Collection\AbstractCollection;
+use Flow\Exception\CrossWikiException;
 use Flow\Exception\DataModelException;
+use Flow\Exception\FlowException;
 use Flow\Exception\PermissionException;
 use Flow\Parsoid\Utils;
 use Title;
diff --git a/includes/Model/Workflow.php b/includes/Model/Workflow.php
index 2d52757..7d8ee4c 100644
--- a/includes/Model/Workflow.php
+++ b/includes/Model/Workflow.php
@@ -156,6 +156,7 @@
        }
 
        /**
+        * @param string $type
         * @param User $user
         * @param Title $title
         * @return Workflow
diff --git a/includes/Notifications/Controller.php 
b/includes/Notifications/Controller.php
index 39809c3..94297ee 100644
--- a/includes/Notifications/Controller.php
+++ b/includes/Notifications/Controller.php
@@ -95,7 +95,7 @@
                }
 
                $title = $data['title'];
-               $user = $data['revision']->getUser();
+               $user = $revision->getUser();
 
                $extraData['revision-id'] = $revision->getRevisionId();
                $extraData['post-id'] = $revision->getPostId();
@@ -500,6 +500,7 @@
        protected static function getTalkPageOwner( $topicId ) {
                $talkUser = array();
                // Owner of talk page should always get a reply notification
+               /** @var Workflow|null $workflow */
                $workflow = Container::get( 'storage' )
                                ->getStorage( 'Workflow' )
                                ->get( UUID::create( $topicId ) );
diff --git a/includes/Notifications/Formatter.php 
b/includes/Notifications/Formatter.php
index c920709..c56c49b 100644
--- a/includes/Notifications/Formatter.php
+++ b/includes/Notifications/Formatter.php
@@ -8,6 +8,7 @@
 use Flow\Parsoid\Utils;
 use EchoBasicFormatter;
 use EchoEvent;
+use Message;
 use Title;
 use User;
 
@@ -60,9 +61,10 @@
 
        /**
         * Helper method for generating a link to post notification
-        * @param \EchoEvent
-        * @param \User
+        * @param EchoEvent $event
+        * @param User $user
         * @return Anchor|boolean
+        * @throws FlowException
         */
        protected function getPostLinkAnchor( EchoEvent $event, User $user ) {
                $urlGenerator = $this->getUrlGenerator();
@@ -109,7 +111,6 @@
         */
        protected function getLinkParams( $event, $user, $destination ) {
                $anchor = null;
-               $title  = $event->getTitle();
 
                // Unfortunately this is not a Flow code path, so we have to 
reach
                //  into global state.
@@ -123,9 +124,12 @@
 
                        case 'flow-topic':
                                $workflowId = $event->getExtraParam( 
'topic-workflow' );
+                               if ( !$workflowId instanceof UUID ) {
+                                       break;
+                               }
                                // Get topic title
                                $title  = Title::makeTitleSafe( NS_TOPIC, 
$workflowId->getAlphadecimal() );
-                               if ( $title && $workflowId ) {
+                               if ( $title ) {
                                        $anchor = $urlGenerator->topicLink( 
$title, $workflowId );
                                }
                                break;
diff --git a/includes/Notifications/UserLocator.php 
b/includes/Notifications/UserLocator.php
index e8d80e5..67e64a7 100644
--- a/includes/Notifications/UserLocator.php
+++ b/includes/Notifications/UserLocator.php
@@ -6,6 +6,7 @@
 use EchoUserLocator;
 use Flow\Model\UUID;
 use Title;
+use User;
 
 class NotificationsUserLocator extends EchoUserLocator {
        /**
diff --git a/includes/Parsoid/BadImageRemover.php 
b/includes/Parsoid/BadImageRemover.php
index fcd3f0c..055de7d 100644
--- a/includes/Parsoid/BadImageRemover.php
+++ b/includes/Parsoid/BadImageRemover.php
@@ -80,8 +80,11 @@
                $linkNodes = $xpath->query( '//img[@data-parsoid]' );
 
                foreach ( $linkNodes as $linkNode ) {
-                       $parsoid = $linkNode->getAttribute( 'data-parsoid' );
-                       $parsoid = FormatJson::decode( $parsoid, true );
+                       $attribute = $linkNode->attributes->getNamedItem( 
'data-parsoid' );
+                       if ( $attribute === null ) {
+                               continue;
+                       }
+                       $parsoid = FormatJson::decode( $attribute->nodeValue, 
true );
                        if ( isset( $parsoid['sa']['resource'] ) ) {
                                $callback( $linkNode, $parsoid );
                        }
diff --git a/includes/Parsoid/ReferenceExtractor.php 
b/includes/Parsoid/ReferenceExtractor.php
index e200b6d..64fecfb 100644
--- a/includes/Parsoid/ReferenceExtractor.php
+++ b/includes/Parsoid/ReferenceExtractor.php
@@ -3,10 +3,7 @@
 namespace Flow\Parsoid;
 
 use DOMXPath;
-use Flow\Exception\InvalidInputException;
-use Flow\Model\URLReference;
 use Flow\Model\UUID;
-use Flow\Model\WikiReference;
 use Flow\Model\Workflow;
 use MWException;
 
@@ -16,12 +13,12 @@
  */
 class ReferenceExtractor {
        /**
-        * @var Extractor\ExtractorInterface[]
+        * @var ExtractorInterface[]
         */
        protected $extractors;
 
        /**
-        * @param Extractor\ExtractorInterface[] $extractors
+        * @param ExtractorInterface[] $extractors
         */
        public function __construct( $extractors ) {
                $this->extractors = $extractors;
@@ -53,7 +50,7 @@
 
                        if ( ! $elements ) {
                                $class = get_class( $extractor );
-                               throw new MWException( "Malformed xpath from 
$class: $query" );
+                               throw new MWException( "Malformed xpath from 
$class: " . $extractor->getXPath() );
                        }
 
                        foreach( $elements as $element ) {
diff --git a/includes/ReferenceClarifier.php b/includes/ReferenceClarifier.php
index db03589..972366c 100644
--- a/includes/ReferenceClarifier.php
+++ b/includes/ReferenceClarifier.php
@@ -3,6 +3,8 @@
 namespace Flow;
 
 use Flow\Data\ManagerGroup;
+use Flow\Model\Reference;
+use Flow\Model\WikiReference;
 use Flow\Exception\CrossWikiException;
 use Flow\Model\UUID;
 use Title;
@@ -53,7 +55,12 @@
                return $props;
        }
 
-       public function getWikiReferences( Title $from, Title $to, $type = null 
) {
+       /**
+        * @param Title $from
+        * @param Title $to
+        * @return WikiReference[]
+        */
+       public function getWikiReferences( Title $from, Title $to ) {
                if ( ! isset( $this->referenceCache[$from->getPrefixedDBkey()] 
) ) {
                        $this->loadReferencesForPage( $from );
                }
@@ -61,9 +68,9 @@
                $fromT = $from->getPrefixedDBkey();
                $toT = 'title:' . $to->getPrefixedDBkey();
 
-               return isset( $this->referenceCache[$fromT][$toT] ) ?
-                       $this->referenceCache[$fromT][$toT] :
-                       array();
+               return isset( $this->referenceCache[$fromT][$toT] )
+                       ? $this->referenceCache[$fromT][$toT]
+                       : array();
        }
 
        protected function getObjectLink( UUID $workflow, $objectType, UUID 
$objectId ) {
@@ -80,6 +87,7 @@
        }
 
        protected function loadReferencesForPage( Title $from ) {
+               /** @var Reference[] $allReferences */
                $allReferences = array();
 
                foreach( array( 'WikiReference', 'URLReference' ) as $refType ) 
{
diff --git a/includes/Repository/TreeRepository.php 
b/includes/Repository/TreeRepository.php
index 7d7437f..4065fd5 100644
--- a/includes/Repository/TreeRepository.php
+++ b/includes/Repository/TreeRepository.php
@@ -51,7 +51,7 @@
 
        /**
         * @param DbFactory $dbFactory Factory to source connection objects from
-        * @param BagOStuff $cache
+        * @param BufferedCache $cache
         */
        public function __construct( DbFactory $dbFactory, BufferedCache $cache 
) {
                $this->dbFactory = $dbFactory;
diff --git a/includes/SubmissionHandler.php b/includes/SubmissionHandler.php
index a7614e3..b4c82b2 100644
--- a/includes/SubmissionHandler.php
+++ b/includes/SubmissionHandler.php
@@ -3,6 +3,7 @@
 namespace Flow;
 
 use Flow\Block\AbstractBlock;
+use Flow\Block\Block;
 use Flow\Model\Workflow;
 use Flow\Data\BufferedCache;
 use Flow\Data\ManagerGroup;
@@ -58,6 +59,7 @@
         */
        public function handleSubmit( Workflow $workflow, $action, array 
$blocks, $user, WebRequest $request ) {
                $success = true;
+               /** @var Block[] $interestedBlocks */
                $interestedBlocks = array();
 
                // since this is a submit force dbFactory to always return 
master
@@ -145,6 +147,7 @@
        /**
         * Helper function extracts parameters from a WebRequest.
         *
+        * @param string $action
         * @param WebRequest $request
         * @param AbstractBlock[] $blocks
         * @return array
diff --git a/includes/TemplateHelper.php b/includes/TemplateHelper.php
index fe543ad..8f87d0a 100644
--- a/includes/TemplateHelper.php
+++ b/includes/TemplateHelper.php
@@ -236,6 +236,7 @@
         * @param array $args Expects string $uuid, string $str, bool 
$timeAgoOnly = false
         * @param array $named No named arguments expected
         * @return null|string
+        * @throws WrongNumberArgumentsException
         */
        static public function uuidTimestamp( array $args, array $named ) {
                if ( count( $args ) < 2 ) {
@@ -259,6 +260,7 @@
         * @param array $args Expects string $timestamp, string $str, bool 
$timeAgoOnly = false
         * @param array $named No named arguments expected
         * @return string
+        * @throws WrongNumberArgumentsException
         */
        static public function timestampHelper( array $args, array $named ) {
                if ( count( $args ) < 2 ) {
@@ -316,7 +318,8 @@
        }
 
        /**
-        * @param array $args Expects string $html, to be output unescaped.
+        * @param array $args Expects one string argument to be output 
unescaped.
+        * @param array $named unused
         * @return array (html, 'raw')
         */
        static public function htmlHelper( array $args, array $named ) {
@@ -327,6 +330,7 @@
         * @param array $args Expects one array $block
         * @param array $named No named arguments expected
         * @return array
+        * @throws WrongNumberArgumentsException
         */
        static public function block( array $args, array $named ) {
                if ( !isset( $args[0] ) ) {
@@ -398,6 +402,7 @@
         * @param array $named No named arguments expected
         * @return float|int
         * @throws Exception\FlowException
+        * @throws WrongNumberArgumentsException
         */
        static public function math( array $args, array $named ) {
                if ( count( $args ) !== 3 ) {
@@ -432,6 +437,7 @@
         * @param array $args Expects array $rootBlock, array $revision
         * @param array $named No named arguments expected
         * @return array
+        * @throws WrongNumberArgumentsException
         */
        static public function post( array $args, array $named ) {
                if ( count( $args ) !== 2 ) {
@@ -448,6 +454,7 @@
         * @param array $args Expects array $revision, string $key = 
'timeAndDate'
         * @param array $named No named arguments expected
         * @return array
+        * @throws WrongNumberArgumentsException
         */
        static public function historyTimestamp( array $args, array $named ) {
                if ( !$args ) {
@@ -493,6 +500,7 @@
         * @param array $args Expects array $revision
         * @param array $named No named arguments expected
         * @return array
+        * @throws WrongNumberArgumentsException
         */
        static public function historyDescription( array $args, array $named ) {
                if ( count( $args ) !== 1 ) {
@@ -510,6 +518,7 @@
         * @param array $args Expects string $old, string $new
         * @param array $named No named arguments expected
         * @return array
+        * @throws WrongNumberArgumentsException
         */
        static public function showCharacterDifference( array $args, array 
$named ) {
                if ( count( $args ) !== 2 ) {
@@ -548,8 +557,8 @@
        }
 
        /**
-        * @param string $str
-        *
+        * @param array $args one or more arguments, i18n key and parameters
+        * @param array $named unused
         * @return array
         */
        static public function l10nParse( array $args, array $named ) {
@@ -569,6 +578,7 @@
         *         string $newLink Url pointing to `new` content
         * @param array $named No named arguments expected
         * @return array HTML wrapped in array to prevent lightncandy from 
escaping
+        * @throws WrongNumberArgumentsException
         */
        static public function diffRevision( array $args, array $named ) {
                if ( count( $args ) !== 7 ) {
@@ -599,6 +609,7 @@
         * @param array $args Expects string $timestamp, string $user, string 
$link
         * @param array $named No named arguments expected
         * @return string
+        * @throws WrongNumberArgumentsException
         */
        static public function generateDiffViewTitle( array $args, array $named 
) {
                if ( count( $args ) !== 3 ) {
@@ -622,6 +633,7 @@
         * @param array $args Expects array $actions, string $moderationState
         * @param array $named No named arguments expected
         * @return string
+        * @throws WrongNumberArgumentsException
         */
        static public function moderationAction( array $args, array $named ) {
                if ( count( $args ) !== 2 ) {
@@ -713,6 +725,7 @@
         * @param array $args Expects string $title
         * @param array $named No named arguments expected
         * @return string modified url
+        * @throws WrongNumberArgumentsException
         */
        static public function linkWithReturnTo( array $args, array $named ) {
                if ( count( $args ) !== 1 ) {
@@ -739,6 +752,7 @@
         * @param array $args Expects string $contentType, string $content
         * @param array $named No named arguments expected
         * @return string
+        * @throws WrongNumberArgumentsException
         */
        static public function escapeContent( array $args, array $named ) {
                if ( count( $args ) !== 2 ) {
@@ -822,6 +836,7 @@
         * @param array $args Expects string $contentFormat, string $content
         * @param array $named No named arguments expected
         * @return string plaintext
+        * @throws WrongNumberArgumentsException
         */
        static public function plaintextSnippet( array $args, array $named ) {
                if ( count( $args ) !== 2 ) {
diff --git a/includes/UrlGenerator.php b/includes/UrlGenerator.php
index 3ad039b..6439305 100644
--- a/includes/UrlGenerator.php
+++ b/includes/UrlGenerator.php
@@ -324,8 +324,8 @@
         * Makes the assumption the title is flow-enabled.
         *
         * @param Title $title
-        * @param string $sortBy
-        * @param string $saveSortBy
+        * @param string|null $sortBy
+        * @param bool $saveSortBy
         * @return Anchor
         */
        public function boardLink( Title $title, $sortBy = null, $saveSortBy = 
false ) {
@@ -430,6 +430,7 @@
         *
         * @param Title|null $title
         * @param UUID $workflowId
+        * @param UUID $postId
         * @param string $moderationAction
         * @param string $flowAction
         * @return Anchor
diff --git a/includes/View.php b/includes/View.php
index 5e748e5..28596ec 100644
--- a/includes/View.php
+++ b/includes/View.php
@@ -7,7 +7,6 @@
 use Flow\Model\Workflow;
 use Html;
 use IContextSource;
-use Linker;
 use Message;
 use ContextSource;
 
diff --git a/includes/WorkflowLoader.php b/includes/WorkflowLoader.php
index cef673d..e84cce8 100644
--- a/includes/WorkflowLoader.php
+++ b/includes/WorkflowLoader.php
@@ -51,6 +51,13 @@
                return $this->blockFactory->createBlocks( $this->workflow );
        }
 
+       /**
+        * @param $action
+        * @param array $blocks
+        * @param $user
+        * @param WebRequest $request
+        * @return Block\AbstractBlock[]
+        */
        public function handleSubmit( $action, array $blocks, $user, WebRequest 
$request ) {
                return $this->submissionHandler->handleSubmit( $this->workflow, 
$action, $blocks, $user, $request );
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/160191
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I54a813b9ad1a0a5c9aa1abfb527184d9745b4794
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: SG <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to