Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/171569
Change subject: Clean up ChangeHandler ...................................................................... Clean up ChangeHandler Change-Id: If258b63807930aacd89cd24da57a1a27648800d6 --- M client/includes/ChangeHandler.php 1 file changed, 27 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/69/171569/1 diff --git a/client/includes/ChangeHandler.php b/client/includes/ChangeHandler.php index 95cc27b..b351085 100644 --- a/client/includes/ChangeHandler.php +++ b/client/includes/ChangeHandler.php @@ -65,7 +65,7 @@ private $affectedPagesFinder; /** - * @var Client\Store\TitleFactory + * @var TitleFactory */ private $titleFactory; @@ -84,6 +84,22 @@ */ private $localSiteId; + /** + * @var bool + */ + private $injectRC; + + /** + * @param EntityChangeFactory $changeFactory + * @param AffectedPagesFinder $affectedPagesFinder + * @param TitleFactory $titleFactory + * @param PageUpdater $updater + * @param EntityRevisionLookup $entityRevisionLookup + * @param string $localSiteId + * @param bool $injectRC + * + * @throws InvalidArgumentException + */ public function __construct( EntityChangeFactory $changeFactory, AffectedPagesFinder $affectedPagesFinder, @@ -93,12 +109,6 @@ $localSiteId, $injectRC ) { - $this->changeFactory = $changeFactory; - $this->affectedPagesFinder = $affectedPagesFinder; - $this->titleFactory = $titleFactory; - $this->updater = $updater; - $this->entityRevisionLookup = $entityRevisionLookup; - if ( !is_string( $localSiteId ) ) { throw new InvalidArgumentException( '$localSiteId must be a string' ); } @@ -107,10 +117,13 @@ throw new InvalidArgumentException( '$injectRC must be a bool' ); } + $this->changeFactory = $changeFactory; + $this->affectedPagesFinder = $affectedPagesFinder; + $this->titleFactory = $titleFactory; + $this->updater = $updater; + $this->entityRevisionLookup = $entityRevisionLookup; $this->localSiteId = $localSiteId; - $this->injectRC = (bool)$injectRC; - - $this->mirrorUpdater = null; + $this->injectRC = $injectRC; } /** @@ -308,7 +321,7 @@ $currentRun[] = $change; // skip any change that failed to process in some way (bug 49417) - } catch ( \Exception $e ) { + } catch ( Exception $e ) { wfLogWarning( __METHOD__ . ':' . $e->getMessage() ); } } @@ -601,7 +614,7 @@ * * @since 0.4 * - * @param \Wikibase\EntityChange $change The Change that caused the update + * @param EntityChange $change The Change that caused the update * * @return array|boolean an array of RC attributes, * or false if the change does not provide edit meta data @@ -652,7 +665,7 @@ * * @param EntityChange $change the change to get a comment for * - * @throws \MWException + * @throws MWException * @return array */ public function getEditComment( EntityChange $change ) { @@ -667,7 +680,7 @@ $editComment = $commentCreator->getEditComment( $siteLinkDiff, $action, $comment ); if( is_array( $editComment ) && !isset( $editComment['message'] ) ) { - throw new \MWException( 'getEditComment returned an empty comment' ); + throw new MWException( 'getEditComment returned an empty comment' ); } return $editComment; -- To view, visit https://gerrit.wikimedia.org/r/171569 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If258b63807930aacd89cd24da57a1a27648800d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits