Daniel Kinzler has submitted this change and it was merged.

Change subject: Remove usage of LibRegistry in WBR API
......................................................................


Remove usage of LibRegistry in WBR API

Change-Id: I8bdbb677f7c47a81a9c6a8df527b2af628723117
---
M repo/includes/api/CreateClaim.php
M repo/includes/api/SetQualifier.php
2 files changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Daniel Kinzler: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/repo/includes/api/CreateClaim.php 
b/repo/includes/api/CreateClaim.php
index 80da322..ffb228e 100644
--- a/repo/includes/api/CreateClaim.php
+++ b/repo/includes/api/CreateClaim.php
@@ -9,6 +9,7 @@
 use Wikibase\Entity;
 use Wikibase\EntityContent;
 use Wikibase\EntityContentFactory;
+use Wikibase\Repo\WikibaseRepo;
 use Wikibase\SnakFactory;
 use Wikibase\LibRegistry;
 use Wikibase\Claim;
@@ -173,10 +174,10 @@
                $params = $this->extractRequestParams();
 
                $factory = new SnakFactory();
-               $libRegistry = new LibRegistry( Settings::singleton() );
+               $entityIdParser = 
WikibaseRepo::getDefaultInstance()->getEntityIdParser();
 
                try {
-                       $entityId = $libRegistry->getEntityIdParser()->parse( 
$params['property'] );
+                       $entityId = $entityIdParser->parse( $params['property'] 
);
                }
                catch ( ParseException $parseException ) {
                        throw new MWException( $parseException->getMessage(), 
'setclaim-invalid-guid' );
diff --git a/repo/includes/api/SetQualifier.php 
b/repo/includes/api/SetQualifier.php
index 99db2aa..a19e09a 100644
--- a/repo/includes/api/SetQualifier.php
+++ b/repo/includes/api/SetQualifier.php
@@ -11,6 +11,7 @@
 use Wikibase\Entity;
 use Wikibase\EntityContentFactory;
 use Wikibase\Claim;
+use Wikibase\Repo\WikibaseRepo;
 use Wikibase\Snaks;
 use Wikibase\SnakFactory;
 use Wikibase\PropertyValueSnak;
@@ -217,10 +218,10 @@
        }
 
        protected function getParsedEntityId( $prefixedId, $errorCode ) {
-               $libRegistry = new LibRegistry( Settings::singleton() );
+               $entityIdParser = 
WikibaseRepo::getDefaultInstance()->getEntityIdParser();
 
                try {
-                       $entityId = $libRegistry->getEntityIdParser()->parse( 
$prefixedId );
+                       $entityId = $entityIdParser->parse( $prefixedId );
                }
                catch ( ParseException $parseException ) {
                        $this->dieUsage( $parseException->getMessage(), 
$errorCode );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8bdbb677f7c47a81a9c6a8df527b2af628723117
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de>
Gerrit-Reviewer: Daniel Werner <daniel.wer...@wikimedia.de>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to