Hoo man has submitted this change and it was merged. Change subject: Clean up MockPropertyLabelResolver ......................................................................
Clean up MockPropertyLabelResolver Change-Id: Ibad4935c6ebd4b726cf2d61bd2fc62e702d233a5 --- M lib/tests/phpunit/MockPropertyLabelResolver.php 1 file changed, 20 insertions(+), 14 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/tests/phpunit/MockPropertyLabelResolver.php b/lib/tests/phpunit/MockPropertyLabelResolver.php index 2a454fc..d9627cf 100644 --- a/lib/tests/phpunit/MockPropertyLabelResolver.php +++ b/lib/tests/phpunit/MockPropertyLabelResolver.php @@ -14,37 +14,43 @@ */ class MockPropertyLabelResolver implements PropertyLabelResolver { - protected $repo; - - protected $lang; + /** + * @var MockRepository + */ + private $mockRepository; /** - * @param string $lang - * @param MockRepository $repo + * @var string */ - public function __construct( $lang, MockRepository $repo ) { - $this->lang = $lang; - $this->repo = $repo; + private $languageCode; + + /** + * @param string $languageCode + * @param MockRepository $mockRepository + */ + public function __construct( $languageCode, MockRepository $mockRepository ) { + $this->languageCode = $languageCode; + $this->mockRepository = $mockRepository; } /** - * @param string[] $labels the labels + * @param string[] $labels * @param string $recache ignored * * @return EntityId[] a map of strings from $labels to the corresponding entity ID. */ public function getPropertyIdsForLabels( array $labels, $recache = '' ) { - $ids = array(); + $entityIds = array(); foreach ( $labels as $label ) { - $prop = $this->repo->getPropertyByLabel( $label, $this->lang ); + $entity = $this->mockRepository->getPropertyByLabel( $label, $this->languageCode ); - if ( $prop !== null ) { - $ids[$label] = $prop->getId(); + if ( $entity !== null ) { + $entityIds[$label] = $entity->getId(); } } - return $ids; + return $entityIds; } } -- To view, visit https://gerrit.wikimedia.org/r/177198 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibad4935c6ebd4b726cf2d61bd2fc62e702d233a5 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits