WikidataBuilder has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/350385 )
Change subject: New Wikidata Build - 2017-04-26T10:00:01+0000
......................................................................
New Wikidata Build - 2017-04-26T10:00:01+0000
Change-Id: I46da7fedb9e39727ffd4cf328a1b5aa6b29faa58
---
M composer.lock
M extensions/Constraints/api/CheckConstraints.php
M extensions/Constraints/i18n/de.json
M extensions/Constraints/i18n/en.json
M extensions/Constraints/i18n/fr.json
M extensions/Constraints/i18n/he.json
M extensions/Constraints/i18n/qqq.json
M extensions/Constraints/i18n/zh-hans.json
M
extensions/Constraints/includes/ConstraintCheck/DelegatingConstraintChecker.php
M extensions/Constraints/includes/ConstraintParameterRenderer.php
M extensions/Constraints/includes/ConstraintReportFactory.php
M extensions/Constraints/includes/ConstraintRepository.php
M extensions/Constraints/maintenance/UpdateConstraintsTable.php
M extensions/Constraints/specials/SpecialConstraintReport.php
M extensions/Constraints/tests/phpunit/Api/CheckConstraintsTest.php
M
extensions/Constraints/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
M
extensions/Constraints/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
M
extensions/Constraints/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
M extensions/Constraints/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
M extensions/Constraints/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
M
extensions/Constraints/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
M extensions/Constraints/tests/phpunit/DelegatingConstraintCheckerTest.php
M
extensions/Constraints/tests/phpunit/Maintenance/UpdateConstraintsTableTest.php
M extensions/Constraints/tests/phpunit/Maintenance/constraints.csv
M extensions/Constraints/tests/phpunit/Result/CheckResultTest.php
M extensions/Wikibase/lib/i18n/lv.json
M extensions/Wikibase/repo/i18n/cs.json
M extensions/Wikibase/repo/i18n/es.json
M extensions/Wikibase/repo/i18n/fr.json
M extensions/Wikibase/repo/i18n/gl.json
M extensions/Wikibase/repo/i18n/he.json
M extensions/Wikibase/repo/i18n/lv.json
M extensions/Wikibase/repo/i18n/qqq.json
M extensions/Wikibase/repo/i18n/zh-hans.json
M extensions/Wikibase/repo/includes/Content/ItemContent.php
M extensions/Wikibase/repo/includes/Specials/SpecialNewProperty.php
M
extensions/Wikibase/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
M extensions/Wikibase/repo/tests/phpunit/includes/Content/ItemContentTest.php
M
extensions/Wikibase/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
M
extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialNewPropertyTest.php
M extensions/Wikibase/view/tests/phpunit/ClaimHtmlGeneratorTest.php
M extensions/Wikibase/view/tests/phpunit/Module/TemplateModuleTest.php
M extensions/Wikibase/view/tests/phpunit/SimpleEntityTermsViewTest.php
M extensions/Wikibase/view/tests/phpunit/SiteLinksViewTest.php
M extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
M extensions/Wikibase/view/tests/phpunit/StatementSectionsViewTest.php
M extensions/Wikibase/view/tests/phpunit/TermsListViewTest.php
M extensions/Wikibase/view/tests/phpunit/ToolbarEditSectionGeneratorTest.php
M extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
M vendor/composer/installed.json
50 files changed, 209 insertions(+), 181 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata
refs/changes/85/350385/1
diff --git a/composer.lock b/composer.lock
index 2303ab1..f4b1ec5 100644
--- a/composer.lock
+++ b/composer.lock
@@ -942,7 +942,7 @@
"source": {
"type": "git",
"url":
"https://gerrit.wikimedia.org/r/mediawiki/extensions/WikibaseQualityConstraints",
- "reference": "3fe99d70424d8e912a622fd60d5ce6ce506864af"
+ "reference": "e93fb8974e2005af0301e96ef9cd2dd492a7ee23"
},
"require": {
"php": ">=5.5.9",
@@ -995,7 +995,7 @@
"support": {
"issues":
"https://phabricator.wikimedia.org/project/profile/1202/"
},
- "time": "2017-04-24 21:02:54"
+ "time": "2017-04-26 07:08:29"
},
{
"name": "wikibase/data-model",
@@ -1565,12 +1565,12 @@
"source": {
"type": "git",
"url":
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git",
- "reference": "52253d5b116df36849b2c44f787cbe3f256fedd2"
+ "reference": "79219df1c2bd05cf006c0d3da1e8bcda9d38a491"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/52253d5b116df36849b2c44f787cbe3f256fedd2",
- "reference": "52253d5b116df36849b2c44f787cbe3f256fedd2",
+ "url":
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/79219df1c2bd05cf006c0d3da1e8bcda9d38a491",
+ "reference": "79219df1c2bd05cf006c0d3da1e8bcda9d38a491",
"shasum": ""
},
"require": {
@@ -1644,7 +1644,7 @@
"wikibaserepo",
"wikidata"
],
- "time": "2017-04-24 21:02:21"
+ "time": "2017-04-26 07:39:03"
},
{
"name": "wikibase/wikimedia-badges",
diff --git a/extensions/Constraints/api/CheckConstraints.php
b/extensions/Constraints/api/CheckConstraints.php
index bf710d0..7000ae1 100644
--- a/extensions/Constraints/api/CheckConstraints.php
+++ b/extensions/Constraints/api/CheckConstraints.php
@@ -10,24 +10,21 @@
use RequestContext;
use ValueFormatters\FormatterOptions;
use Wikibase\ChangeOp\StatementChangeOpFactory;
-use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Entity\EntityIdParser;
use Wikibase\DataModel\Entity\EntityIdParsingException;
-use Wikibase\DataModel\Entity\PropertyId;
-use Wikibase\DataModel\Services\EntityId\EntityIdFormatter;
-use Wikibase\DataModel\Services\Lookup\TermLookup;
use Wikibase\DataModel\Services\Statement\StatementGuidParser;
use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
-use Wikibase\DataModel\Services\Term\TermBuffer;
use Wikibase\LanguageFallbackChainFactory;
use Wikibase\Lib\OutputFormatValueFormatterFactory;
use Wikibase\Lib\SnakFormatter;
use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory;
use Wikibase\Repo\Api\ApiErrorReporter;
use Wikibase\Repo\Api\ApiHelperFactory;
+use Wikibase\Repo\Api\ResultBuilder;
use Wikibase\Repo\EntityIdLabelFormatterFactory;
use Wikibase\Repo\WikibaseRepo;
use
WikibaseQuality\ConstraintReport\ConstraintCheck\DelegatingConstraintChecker;
+use WikibaseQuality\ConstraintReport\ConstraintCheck\Result\CheckResult;
use WikibaseQuality\ConstraintReport\ConstraintParameterRenderer;
use WikibaseQuality\ConstraintReport\ConstraintReportFactory;
use Wikimedia\Assert\Assert;
@@ -69,16 +66,15 @@
private $delegatingConstraintChecker;
/**
+ * @var ResultBuilder
+ */
+ private $resultBuilder;
+
+ /**
*
* @var ApiErrorReporter
*/
private $errorReporter;
-
- /**
- *
- * @var EntityIdFormatter
- */
- private $entityIdLabelFormatter;
/**
*
@@ -93,11 +89,6 @@
private $constraintParameterRenderer;
/**
- * @var TermLookup
- */
- private $termLookup;
-
- /**
* Creates new instance from global state.
*
* @param ApiMain $main
@@ -109,7 +100,6 @@
public static function newFromGlobalState( ApiMain $main, $name,
$prefix = '' ) {
$repo = WikibaseRepo::getDefaultInstance();
$constraintReportFactory =
ConstraintReportFactory::getDefaultInstance();
- $changeOpFactoryProvider = $repo->getChangeOpFactoryProvider();
$termLookup = $repo->getTermLookup();
$termBuffer = $repo->getTermBuffer();
$languageFallbackChainFactory = new
LanguageFallbackChainFactory();
@@ -133,7 +123,6 @@
}
/**
- *
* @param ApiMain $main
* @param string $name
* @param string $prefix
@@ -153,7 +142,6 @@
parent::__construct( $main, $name, $prefix );
$repo = WikibaseRepo::getDefaultInstance();
- $this->statementDeserializer =
$repo->getExternalFormatStatementDeserializer();
$changeOpFactoryProvider = $repo->getChangeOpFactoryProvider();
$this->statementChangeOpFactory =
$changeOpFactoryProvider->getStatementChangeOpFactory();
@@ -191,8 +179,8 @@
private function checkItems( array $entityIds, $constraintIds ) {
-
$checkResults = [];
+
foreach ( $entityIds as $entityId ) {
$currentCheckResults =
$this->delegatingConstraintChecker->checkAgainstConstraintsOnEntityId(
$entityId, $constraintIds );
@@ -205,8 +193,8 @@
}
private function checkClaimIds( array $claimIds, $constraintIds ) {
-
$checkResults = [];
+
foreach ( $claimIds as $claimId ) {
$currentCheckResults =
$this->delegatingConstraintChecker->checkAgainstConstraintsOnClaimId(
$claimId, $constraintIds );
@@ -220,48 +208,42 @@
private function parseEntityIds( array $params ) {
$ids = $params[self::PARAM_ID];
- if ( $ids !== null ) {
- if ( $ids ) {
- foreach ( $ids as $id ) {
- try {
- $entityIds[] =
$this->entityIdParser->parse( $id );
- } catch ( EntityIdParsingException $e )
{
- $this->errorReporter->dieError(
- "Invalid id: $id",
'invalid-entity-id', 0, [ self::PARAM_ID => $id ] );
- }
- }
- return $entityIds;
- } else {
- $paramId = self::PARAM_ID;
- $this->errorReporter->dieError(
- "If $paramId is specified, it must be
nonempty.", 'no-data' );
- }
- } else {
+
+ if ( $ids === null ) {
return [];
+ } elseif ( $ids === [] ) {
+ $this->errorReporter->dieError(
+ 'If ' . self::PARAM_ID . ' is specified, it
must be nonempty.', 'no-data' );
}
+
+ return array_map( function ( $id ) {
+ try {
+ return $this->entityIdParser->parse( $id );
+ } catch ( EntityIdParsingException $e ) {
+ $this->errorReporter->dieError(
+ "Invalid id: $id", 'invalid-entity-id',
0, [ self::PARAM_ID => $id ] );
+ }
+ }, $ids );
}
private function parseClaimIds( array $params ) {
$ids = $params[self::PARAM_CLAIM_ID];
- if ( $ids !== null ) {
- if ( $ids ) {
- foreach ( $ids as $id ) {
- try {
- $claimIds[] =
$this->statementGuidParser->parse( $id );
- } catch ( EntityIdParsingException $e )
{
- $this->errorReporter->dieError(
- "Invalid claim id:
$id", 'invalid-guid', 0, [ self::PARAM_CLAIM_ID => $id ] );
- }
- }
- return $claimIds;
- } else {
- $paramClaimId = self::PARAM_CLAIM_ID;
- $this->errorReporter->dieError(
- "If $paramClaimId is specified, it must
be nonempty.", 'no-data' );
- }
- } else {
+
+ if ( $ids === null ) {
return [];
+ } elseif ( $ids === [] ) {
+ $this->errorReporter->dieError(
+ 'If ' . self::PARAM_CLAIM_ID . ' is specified,
it must be nonempty.', 'no-data' );
}
+
+ return array_map( function ( $id ) {
+ try {
+ return $this->statementGuidParser->parse( $id );
+ } catch ( EntityIdParsingException $e ) {
+ $this->errorReporter->dieError(
+ "Invalid claim id: $id",
'invalid-guid', 0, [ self::PARAM_CLAIM_ID => $id ] );
+ }
+ }, $ids );
}
private function validateParameters( array $params ) {
@@ -293,7 +275,6 @@
* @return array
*/
private function buildResult( array $checkResults, $entityIds = null ) {
-
$constraintReport = array();
ApiResult::setArrayType( $constraintReport, 'assoc' );
@@ -306,7 +287,6 @@
}
foreach ( $checkResults as $checkResult ) {
-
$statement = $checkResult->getStatement();
$entityId =
$checkResult->getEntityId()->getSerialization();
@@ -362,8 +342,13 @@
* @codeCoverageIgnore
*/
public function getExamplesMessages() {
- // TODO Add examples
- return [];
+ return [
+ 'action=wbcheckconstraints&id=Q5|Q42'
+ => 'apihelp-wbcheckconstraints-example-1',
+
'action=wbcheckconstraints&claimid=Q42%248419C20C-8EF8-4EC0-80D6-AF1CA55E7557'
+ => 'apihelp-wbcheckconstraints-example-2'
+ // TODO add more examples, at least one for the
constraintid parameter
+ ];
}
}
diff --git a/extensions/Constraints/i18n/de.json
b/extensions/Constraints/i18n/de.json
index 97bbbd3..d1c64c6 100644
--- a/extensions/Constraints/i18n/de.json
+++ b/extensions/Constraints/i18n/de.json
@@ -31,6 +31,8 @@
"apihelp-wbcheckconstraints-param-id": "Kennung der Objektliste, von
der die Daten abgerufen werden sollen. Mehrere Werte mit „|“ oder Ähnlichem
trennen.",
"apihelp-wbcheckconstraints-param-claimid": "GUID-Liste, die eine
Behauptung erkennt, um einen Beschränkungsbericht zu prüfen. Mehrere Werte mit
„|“ trennen.",
"apihelp-wbcheckconstraints-param-constraintid": "Optionaler Filter, um
nur die Beschränkungen zurückzugeben, die die angegebenen
Beschränkungskennungen haben.",
+ "apihelp-wbcheckconstraints-example-1": "Überprüft alle Beschränkungen
der Objekte Q5 und Q42.",
+ "apihelp-wbcheckconstraints-example-2": "Überprüft alle Beschränkungen
einer einzelnen Aussage.",
"wbq-subextension-name-wbqc": "Beschränkungen",
"wbqc-violation-header-parameters": "Parameter:",
"wbqc-violations-group": "Beschränkungen",
diff --git a/extensions/Constraints/i18n/en.json
b/extensions/Constraints/i18n/en.json
index c01e399..2ef96f6 100644
--- a/extensions/Constraints/i18n/en.json
+++ b/extensions/Constraints/i18n/en.json
@@ -33,6 +33,9 @@
"apihelp-wbcheckconstraints-param-claimid": "GUID list identifying a
claim to check a constraint report. Separate values with '|'.",
"apihelp-wbcheckconstraints-param-constraintid": "Optional filter to
return only the constraints that have the specified constraint ID",
+ "apihelp-wbcheckconstraints-example-1": "Check all constraints on the
items Q5 and Q42.",
+ "apihelp-wbcheckconstraints-example-2": "Check all constraints on a
single statement.",
+
"wbq-subextension-name-wbqc": "Constraints",
"wbqc-violation-header-parameters": "Parameters:",
"wbqc-violations-group": "Constraints",
diff --git a/extensions/Constraints/i18n/fr.json
b/extensions/Constraints/i18n/fr.json
index a7cb0b0..33d604c 100644
--- a/extensions/Constraints/i18n/fr.json
+++ b/extensions/Constraints/i18n/fr.json
@@ -33,6 +33,8 @@
"apihelp-wbcheckconstraints-param-id": "Liste d'ID des entités pour
lesquelles ont veux les informations. Séparez les valeurs avec '|' ou
similaire.",
"apihelp-wbcheckconstraints-param-claimid": "Liste de GUID identifiant
une demande de vérification d'un rapport de contraintes. Valeurs séparées par
'|'.",
"apihelp-wbcheckconstraints-param-constraintid": "Filtre optionnel pour
ne retourner que les contraintes qui ont l'ID de contrainte spécifié",
+ "apihelp-wbcheckconstraints-example-1": "Vérifier toutes les
contraintes sur les éléments Q5 et Q42.",
+ "apihelp-wbcheckconstraints-example-2": "Vérifier toutes les
contraintes sur une seule affirmation.",
"wbq-subextension-name-wbqc": "Contraintes",
"wbqc-violation-header-parameters": "Paramètres :",
"wbqc-violations-group": "Contraintes",
diff --git a/extensions/Constraints/i18n/he.json
b/extensions/Constraints/i18n/he.json
index d3591dc..8d62524 100644
--- a/extensions/Constraints/i18n/he.json
+++ b/extensions/Constraints/i18n/he.json
@@ -29,6 +29,8 @@
"apihelp-wbcheckconstraints-param-id": "רשימת מזהי ישויות שמהן צריך
לקבל נתונים. יש להפריד את הערכים בתו '|' או חלופות.",
"apihelp-wbcheckconstraints-param-claimid": "רשימת GUID־ים שמזהים טענה
שצריך לבדוק אל מול דו\"ח אילוצים. יש להפריד ערכים בתו '|'.",
"apihelp-wbcheckconstraints-param-constraintid": "מסנן אופציונלי שיחזיר
רק את האילוצים שיש להם מזה אילוץ שצוין",
+ "apihelp-wbcheckconstraints-example-1": "בדיקה של כל האילוצים על
הפריטים Q5 ו־Q42.",
+ "apihelp-wbcheckconstraints-example-2": "בדיקת כל האילוצים על טענה
בודדת.",
"wbq-subextension-name-wbqc": "אילוצים",
"wbqc-violation-header-parameters": "פרמטרים:",
"wbqc-violations-group": "אילוצים",
diff --git a/extensions/Constraints/i18n/qqq.json
b/extensions/Constraints/i18n/qqq.json
index 2c97639..6721dcf 100644
--- a/extensions/Constraints/i18n/qqq.json
+++ b/extensions/Constraints/i18n/qqq.json
@@ -31,6 +31,8 @@
"apihelp-wbcheckconstraints-param-id":
"{{doc-apihelp-param|wbcheckconstraints|id}}",
"apihelp-wbcheckconstraints-param-claimid":
"{{doc-apihelp-param|wbcheckconstraints|claimid}}",
"apihelp-wbcheckconstraints-param-constraintid":
"{{doc-apihelp-param|wbcheckconstraints|constraintid}}",
+ "apihelp-wbcheckconstraints-example-1":
"{{doc-apihelp-example|wbcheckconstraints}}",
+ "apihelp-wbcheckconstraints-example-2":
"{{doc-apihelp-example|wbcheckconstraints}}",
"wbq-subextension-name-wbqc": "Name of this subextension. Is shown in
special page that lists all the violations.\n{{Identical|Constraint}}",
"wbqc-violation-header-parameters": "Header for section in violations
special page that displays the parameters of the
constraint.\n{{Identical|Parameter}}",
"wbqc-violations-group": "Type of violations this extension
finds.\n{{Identical|Constraint}}",
diff --git a/extensions/Constraints/i18n/zh-hans.json
b/extensions/Constraints/i18n/zh-hans.json
index 0a42cfe..c802c9e 100644
--- a/extensions/Constraints/i18n/zh-hans.json
+++ b/extensions/Constraints/i18n/zh-hans.json
@@ -29,6 +29,8 @@
"apihelp-wbcheckconstraints-param-id": "要获取数据的实体ID列表。使用“|”或替代字符分隔值。",
"apihelp-wbcheckconstraints-param-claimid":
"识别要检查约束报告的声称的GUID列表。使用“|”分隔值。",
"apihelp-wbcheckconstraints-param-constraintid": "可选的过滤器,只返回有指定约束ID的约束",
+ "apihelp-wbcheckconstraints-example-1": "检查项Q5和Q42的所有约束。",
+ "apihelp-wbcheckconstraints-example-2": "检查单一声明上的所有约束。",
"wbq-subextension-name-wbqc": "约束",
"wbqc-violation-header-parameters": "参数:",
"wbqc-violations-group": "约束",
diff --git
a/extensions/Constraints/includes/ConstraintCheck/DelegatingConstraintChecker.php
b/extensions/Constraints/includes/ConstraintCheck/DelegatingConstraintChecker.php
index 79c2bed..488d13b 100644
---
a/extensions/Constraints/includes/ConstraintCheck/DelegatingConstraintChecker.php
+++
b/extensions/Constraints/includes/ConstraintCheck/DelegatingConstraintChecker.php
@@ -257,7 +257,21 @@
$orderB = array_key_exists( $statusB, $order ) ?
$order[ $statusB ] : $order[ 'other' ];
if ( $orderA === $orderB ) {
- return 0;
+ $pidA = $a->getPropertyId()->getSerialization();
+ $pidB = $b->getPropertyId()->getSerialization();
+
+ if ( $pidA === $pidB ) {
+ $hashA = $a->getStatement()->getHash();
+ $hashB = $b->getStatement()->getHash();
+
+ if ( $hashA === $hashB ) {
+ return 0;
+ } else {
+ return ( $hashA > $hashB ) ? 1
: -1;
+ }
+ } else {
+ return ( $pidA > $pidB ) ? 1 : -1;
+ }
} else {
return ( $orderA > $orderB ) ? 1 : -1;
}
diff --git a/extensions/Constraints/includes/ConstraintParameterRenderer.php
b/extensions/Constraints/includes/ConstraintParameterRenderer.php
index cbb1778..6d68fa5 100644
--- a/extensions/Constraints/includes/ConstraintParameterRenderer.php
+++ b/extensions/Constraints/includes/ConstraintParameterRenderer.php
@@ -1,28 +1,12 @@
<?php
namespace WikibaseQuality\ConstraintReport;
-use DataValues;
use DataValues\DataValue;
-use HTMLForm;
-use Html;
-use InvalidArgumentException;
-use SpecialPage;
-use UnexpectedValueException;
use ValueFormatters\ValueFormatter;
use Wikibase\DataModel\Entity\EntityId;
-use Wikibase\DataModel\Entity\EntityIdParser;
-use Wikibase\DataModel\Entity\EntityIdParsingException;
-use Wikibase\DataModel\Entity\EntityIdValue;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\DataModel\Services\EntityId\EntityIdFormatter;
-use Wikibase\DataModel\Services\Lookup\EntityLookup;
-use Wikibase\Lib\OutputFormatValueFormatterFactory;
-use Wikibase\Lib\SnakFormatter;
-use Wikibase\Lib\Store\EntityTitleLookup;
-use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory;
-use Wikibase\Repo\EntityIdHtmlLinkFormatterFactory;
-use Wikibase\Repo\EntityIdLabelFormatterFactory;
/**
* Class ConstraintParameterRenderer
@@ -129,4 +113,4 @@
return $array;
}
-}
\ No newline at end of file
+}
diff --git a/extensions/Constraints/includes/ConstraintReportFactory.php
b/extensions/Constraints/includes/ConstraintReportFactory.php
index 25db4eb..89f2356 100644
--- a/extensions/Constraints/includes/ConstraintReportFactory.php
+++ b/extensions/Constraints/includes/ConstraintReportFactory.php
@@ -89,10 +89,6 @@
return $instance;
}
- /**
- * @param EntityLookup $lookup
- * @param StatementGuidParser $statementGuidParser
- */
public function __construct( EntityLookup $lookup, StatementGuidParser
$statementGuidParser, Config $config ) {
$this->lookup = $lookup;
$this->statementGuidParser = $statementGuidParser;
diff --git a/extensions/Constraints/includes/ConstraintRepository.php
b/extensions/Constraints/includes/ConstraintRepository.php
index dc39e52..5d2194b 100644
--- a/extensions/Constraints/includes/ConstraintRepository.php
+++ b/extensions/Constraints/includes/ConstraintRepository.php
@@ -4,6 +4,7 @@
use DBUnexpectedError;
use InvalidArgumentException;
+use Wikimedia\Rdbms\LikeMatch;
use ResultWrapper;
use Wikibase\DataModel\Entity\PropertyId;
@@ -55,6 +56,36 @@
}
/**
+ * @param LikeMatch $any should be IDatabase::anyChar()
+ *
+ * @return array
+ */
+ private function uuidPattern( LikeMatch $any ) {
+ return array_merge(
+ array_fill( 0, 8, $any ), [ '-' ],
+ array_fill( 0, 4, $any ), [ '-' ],
+ array_fill( 0, 4, $any ), [ '-' ],
+ array_fill( 0, 4, $any ), [ '-' ],
+ array_fill( 0, 12, $any )
+ );
+ }
+
+ /**
+ * Delete all constraints where the constraint ID is a UUID
+ * (formatted in groups of 8-4-4-4-12 digits).
+ *
+ * @throws DBUnexpectedError
+ */
+ public function deleteWhereConstraintIdIsUuid() {
+ $db = wfGetDB( DB_MASTER );
+ $db->delete(
+ CONSTRAINT_TABLE,
+ // WHERE constraint_guid LIKE
________-____-____-____-____________
+ 'constraint_guid ' . $db->buildLike(
$this->uuidPattern( $db->anyChar() ) )
+ );
+ }
+
+ /**
* @param int $batchSize
*
* @throws InvalidArgumentException
diff --git a/extensions/Constraints/maintenance/UpdateConstraintsTable.php
b/extensions/Constraints/maintenance/UpdateConstraintsTable.php
index f66bda5..7880eff 100644
--- a/extensions/Constraints/maintenance/UpdateConstraintsTable.php
+++ b/extensions/Constraints/maintenance/UpdateConstraintsTable.php
@@ -44,7 +44,7 @@
}
$constraintRepo =
ConstraintReportFactory::getDefaultInstance()->getConstraintRepository();
- $constraintRepo->deleteAll( $this->mBatchSize );
+ $constraintRepo->deleteWhereConstraintIdIsUuid();
$this->insertValues( $constraintRepo, $csvFile );
fclose( $csvFile );
}
diff --git a/extensions/Constraints/specials/SpecialConstraintReport.php
b/extensions/Constraints/specials/SpecialConstraintReport.php
index 6d7c713..619751f 100644
--- a/extensions/Constraints/specials/SpecialConstraintReport.php
+++ b/extensions/Constraints/specials/SpecialConstraintReport.php
@@ -2,7 +2,6 @@
namespace WikibaseQuality\ConstraintReport\Specials;
-use DataValues;
use DataValues\DataValue;
use Html;
use HTMLForm;
@@ -18,7 +17,6 @@
use Wikibase\DataModel\Entity\EntityIdParser;
use Wikibase\DataModel\Entity\EntityIdParsingException;
use Wikibase\DataModel\Entity\EntityIdValue;
-use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\DataModel\Services\EntityId\EntityIdFormatter;
use Wikibase\DataModel\Services\Lookup\EntityLookup;
diff --git a/extensions/Constraints/tests/phpunit/Api/CheckConstraintsTest.php
b/extensions/Constraints/tests/phpunit/Api/CheckConstraintsTest.php
index c54ad1d..b152bf1 100644
--- a/extensions/Constraints/tests/phpunit/Api/CheckConstraintsTest.php
+++ b/extensions/Constraints/tests/phpunit/Api/CheckConstraintsTest.php
@@ -24,10 +24,7 @@
use WikibaseQuality\ConstraintReport\ConstraintCheck\Result\CheckResult;
use WikibaseQuality\ConstraintReport\Tests\Fake\FakeChecker;
use WikibaseQuality\ConstraintReport\Tests\Fake\InMemoryConstraintLookup;
-use Wikibase\LanguageFallbackChain;
use Wikibase\LanguageFallbackChainFactory;
-use Wikibase\DataModel\Services\Lookup\TermLookup;
-use Wikibase\DataModel\Services\Term\TermBuffer;
use Wikibase\Lib\SnakFormatter;
use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory;
use Wikibase\Lib\OutputFormatValueFormatterFactory;
diff --git
a/extensions/Constraints/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
b/extensions/Constraints/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
index 17f9694..5908030 100644
---
a/extensions/Constraints/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
+++
b/extensions/Constraints/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
@@ -2,6 +2,7 @@
namespace WikibaseQuality\ConstraintReport\Test\CommonsLinkChecker;
+use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Snak\PropertyNoValueSnak;
use Wikibase\DataModel\Statement\Statement;
use Wikibase\DataModel\Snak\PropertyValueSnak;
diff --git
a/extensions/Constraints/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
b/extensions/Constraints/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
index 816ec95..384901c 100644
---
a/extensions/Constraints/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
+++
b/extensions/Constraints/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
@@ -2,6 +2,7 @@
namespace WikibaseQuality\ConstraintReport\Test\ConnectionChecker;
+use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Snak\PropertyNoValueSnak;
use Wikibase\DataModel\Statement\Statement;
use Wikibase\DataModel\Snak\PropertyValueSnak;
diff --git
a/extensions/Constraints/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
b/extensions/Constraints/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
index 12d64fd..2a630b1 100644
---
a/extensions/Constraints/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
+++
b/extensions/Constraints/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
@@ -2,6 +2,7 @@
namespace WikibaseQuality\ConstraintReport\Test\FormatChecker;
+use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Snak\PropertyNoValueSnak;
use Wikibase\DataModel\Statement\Statement;
use Wikibase\DataModel\Snak\PropertyValueSnak;
diff --git
a/extensions/Constraints/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
b/extensions/Constraints/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
index 3df6413..71353b9 100644
---
a/extensions/Constraints/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
+++
b/extensions/Constraints/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
@@ -2,6 +2,7 @@
namespace WikibaseQuality\ConstraintReport\Test\OneOfChecker;
+use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Snak\PropertyNoValueSnak;
use Wikibase\DataModel\Statement\Statement;
use Wikibase\DataModel\Snak\PropertyValueSnak;
diff --git
a/extensions/Constraints/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
b/extensions/Constraints/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
index 2eebd07..0f14c35 100644
---
a/extensions/Constraints/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
+++
b/extensions/Constraints/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
@@ -2,6 +2,7 @@
namespace WikibaseQuality\ConstraintReport\Test\RangeChecker;
+use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Snak\PropertyNoValueSnak;
use Wikibase\DataModel\Statement\Statement;
use Wikibase\DataModel\Snak\PropertyValueSnak;
diff --git
a/extensions/Constraints/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
b/extensions/Constraints/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
index 786d432..d5d3f62 100644
---
a/extensions/Constraints/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
+++
b/extensions/Constraints/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
@@ -3,6 +3,7 @@
namespace WikibaseQuality\ConstraintReport\Test\TypeChecker;
use HashConfig;
+use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Statement\Statement;
use Wikibase\DataModel\Snak\PropertyValueSnak;
use Wikibase\DataModel\Entity\EntityIdValue;
diff --git
a/extensions/Constraints/tests/phpunit/DelegatingConstraintCheckerTest.php
b/extensions/Constraints/tests/phpunit/DelegatingConstraintCheckerTest.php
index 9b32680..0711340 100644
--- a/extensions/Constraints/tests/phpunit/DelegatingConstraintCheckerTest.php
+++ b/extensions/Constraints/tests/phpunit/DelegatingConstraintCheckerTest.php
@@ -3,13 +3,10 @@
namespace WikibaseQuality\ConstraintReport\Test\ConstraintChecker;
use HashConfig;
-use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Entity\ItemIdParser;
use Wikibase\DataModel\Services\Statement\StatementGuidParser;
-use Wikibase\DataModel\Statement\Statement;
use
WikibaseQuality\ConstraintReport\ConstraintCheck\DelegatingConstraintChecker;
-use WikibaseQuality\ConstraintReport\ConstraintCheck\Result\CheckResult;
use WikibaseQuality\ConstraintReport\ConstraintReportFactory;
use WikibaseQuality\Tests\Helper\JsonFileEntityLookup;
diff --git
a/extensions/Constraints/tests/phpunit/Maintenance/UpdateConstraintsTableTest.php
b/extensions/Constraints/tests/phpunit/Maintenance/UpdateConstraintsTableTest.php
index 301e89b..5e65d03 100644
---
a/extensions/Constraints/tests/phpunit/Maintenance/UpdateConstraintsTableTest.php
+++
b/extensions/Constraints/tests/phpunit/Maintenance/UpdateConstraintsTableTest.php
@@ -26,14 +26,16 @@
public function addDBData() {
$this->db->delete( CONSTRAINT_TABLE, '*' );
$this->db->insert( CONSTRAINT_TABLE, [
+ // a constraint imported from a template (UUID)
[
- 'constraint_guid' => 'foo',
+ 'constraint_guid' =>
'afbbe0c2-2bc4-47b6-958c-a318a53814ac',
'pid' => 42,
'constraint_type_qid' => 'TestConstraint',
'constraint_parameters' => '{}'
],
+ // a constraint imported from a statement (statement ID)
[
- 'constraint_guid' => 'bar',
+ 'constraint_guid' =>
'P2$2892c48c-53e5-40ef-94a2-274ebf35075c',
'pid' => 42,
'constraint_type_qid' => 'TestConstraint',
'constraint_parameters' => '{}'
@@ -61,24 +63,33 @@
],
[],
[
+ // existing constraint imported from a
statement is not deleted
[
- 'baz',
+
'P2$2892c48c-53e5-40ef-94a2-274ebf35075c',
+ 42,
+ 'TestConstraint',
+ '{}'
+ ],
+ // new constraints
+ [
+ 'c3d49df6-a4f1-413d-903d-57907aa439f9',
'42',
'ConstraintFromCsv',
'{"foo":"bar"}'
],
[
- 'foobar',
- '42',
- 'ConstraintFromCsv',
- '{"foobar":"bar"}'
- ],
- [
- 'foobaz',
+ 'daa9c35c-0455-4c8d-8804-a73cd78fcc4a',
'42',
'ConstraintFromCsv',
'{"bar":"baz"}'
],
+ [
+ 'e28b1517-a7f6-4479-bdc8-6687e944ba31',
+ '42',
+ 'ConstraintFromCsv',
+ '{"foobar":"bar"}'
+ ],
+ // existing constrant imported from a template
is deleted
]
);
}
diff --git a/extensions/Constraints/tests/phpunit/Maintenance/constraints.csv
b/extensions/Constraints/tests/phpunit/Maintenance/constraints.csv
index c832c5a..cfb52a4 100644
--- a/extensions/Constraints/tests/phpunit/Maintenance/constraints.csv
+++ b/extensions/Constraints/tests/phpunit/Maintenance/constraints.csv
@@ -1,3 +1,3 @@
-"baz","42","ConstraintFromCsv","{""foo"":""bar""}"
-"foobaz","42","ConstraintFromCsv","{""bar"":""baz""}"
-"foobar","42","ConstraintFromCsv","{""foobar"":""bar""}"
\ No newline at end of file
+"c3d49df6-a4f1-413d-903d-57907aa439f9","42","ConstraintFromCsv","{""foo"":""bar""}"
+"daa9c35c-0455-4c8d-8804-a73cd78fcc4a","42","ConstraintFromCsv","{""bar"":""baz""}"
+"e28b1517-a7f6-4479-bdc8-6687e944ba31","42","ConstraintFromCsv","{""foobar"":""bar""}"
\ No newline at end of file
diff --git a/extensions/Constraints/tests/phpunit/Result/CheckResultTest.php
b/extensions/Constraints/tests/phpunit/Result/CheckResultTest.php
index 348643b..bbde763 100644
--- a/extensions/Constraints/tests/phpunit/Result/CheckResultTest.php
+++ b/extensions/Constraints/tests/phpunit/Result/CheckResultTest.php
@@ -4,10 +4,10 @@
use LogicException;
use PHPUnit_Framework_TestCase;
+use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Snak\PropertyNoValueSnak;
use Wikibase\DataModel\Statement\Statement;
use Wikibase\DataModel\Snak\PropertyValueSnak;
-use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Entity\PropertyId;
use DataValues\StringValue;
@@ -38,6 +38,11 @@
private $constraintName;
/**
+ * @var string
+ */
+ private $constraintId;
+
+ /**
* @var array
*/
private $parameters;
diff --git a/extensions/Wikibase/lib/i18n/lv.json
b/extensions/Wikibase/lib/i18n/lv.json
index 1f49aa6..fa93e4f 100644
--- a/extensions/Wikibase/lib/i18n/lv.json
+++ b/extensions/Wikibase/lib/i18n/lv.json
@@ -38,6 +38,7 @@
"datatypes-type-wikibase-item": "Ieraksts",
"datatypes-type-wikibase-property": "Īpašība",
"datatypes-type-commonsMedia": "Commons multivides fails",
+ "datatypes-type-tabular-data": "Tabulāri dati",
"datatypes-type-external-id": "Ārējais identifikators",
"wikibase-time-precision-millennium": "$1. tūkstošgade",
"wikibase-time-precision-century": "$1. gadsimts",
diff --git a/extensions/Wikibase/repo/i18n/cs.json
b/extensions/Wikibase/repo/i18n/cs.json
index ca775bc..9149b30 100644
--- a/extensions/Wikibase/repo/i18n/cs.json
+++ b/extensions/Wikibase/repo/i18n/cs.json
@@ -185,6 +185,7 @@
"wikibase-newproperty-datatype": "Datový typ:",
"wikibase-newproperty-invalid-datatype": "Zadán neplatný datový typ.",
"wikibase-newproperty-insufficient-data": "Musíte vyplnit alespoň buď
štítek, popisek, nebo aliasy.",
+ "wikibase-newproperty-pick-data-type": "(vyberte datový typ)",
"wikibase-description-helppage": "Help:Popisky",
"wikibase-label-helppage": "Help:Štítek",
"special-newitem": "Vytvořit novou položku",
@@ -323,6 +324,7 @@
"wikibase-restoreold": "obnovit",
"wikibase-entity-summary-restore": "Obnovena revize $3 od
{{GENDER:$4|uživatele|uživatelky}} [[Special:Contributions/$4|$4]]",
"wikibase-entity-summary-undo": "Zrušena verze $3 od
{{GENDER:$4|uživatele|uživatelky}} [[Special:Contributions/$4|$4]] ([[User
talk:$4|diskuse]])",
+ "wikibase-non-entity-diff": "Nelze porovnat obsah entity s obsahem
ne-entity.",
"wikibase-no-direct-editing": "Ve jmenném prostoru $1 není přímé
editování povoleno",
"wikibase-noentity": "Tato entita neexistuje. Co se s ní stalo,
zjistíte [{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} vyhledáváním v
příslušných protokolovacích záznamech].",
"wikibase-noentity-createone": "Můžete také [[$1|vytvořit nový]].",
diff --git a/extensions/Wikibase/repo/i18n/es.json
b/extensions/Wikibase/repo/i18n/es.json
index e21608d..4d4524d 100644
--- a/extensions/Wikibase/repo/i18n/es.json
+++ b/extensions/Wikibase/repo/i18n/es.json
@@ -34,7 +34,8 @@
"AlvaroMolina",
"Lemondoge",
"Rubentl134",
- "Dgstranz"
+ "Dgstranz",
+ "Luzcaru"
]
},
"wikibase-desc": "Repositorio de datos estructurados",
@@ -149,6 +150,8 @@
"wikibase-validator-label-with-description-conflict": "El elemento $3
ya tiene la etiqueta \"$1\" asociada con el código de idioma $2, usando el
mismo texto de descripción.",
"wikibase-validator-label-no-entityid": "La etiqueta no debe ser un
identificador de entidad válido.",
"wikibase-validator-illegal-file-chars": "Los nombres de archivo no
pueden contener caracteres como dos puntos o barras. Por favor, pega solo el
nombre del archivo que va después de «File:».",
+ "wikibase-validator-illegal-geo-shape-title": "El valor debe comenzar
<code>Data:</code> y terminar con <code>.map</ code>. Además, el título no debe
contener caracteres especiales como coma, barra inclinada o vertical.",
+ "wikibase-validator-illegal-tabular-data-title": "El valor debe
comenzar con <code>Data:</code> y terminar con <code>.map</code>. Además, el
título no debe contener caracteres especiales como coma, barra inclinada ó
vertical.",
"wikibase-validator-no-such-media": "El archivo \"$1\" no existe en
[https://commons.wikimedia.org/ Wikimedia Commons].",
"wikibase-validator-page-not-exists": "La página «$1» no existe.",
"wikibase-validator-not-a-language": "«$1» no es un código de idioma
conocido.",
@@ -197,6 +200,7 @@
"wikibase-newproperty-datatype": "Tipo de dato:",
"wikibase-newproperty-invalid-datatype": "El tipo de datos especificado
no es válido.",
"wikibase-newproperty-insufficient-data": "Necesitas indicar al menos
la etiqueta, la descripción o los alias.",
+ "wikibase-newproperty-pick-data-type": "(elegir un tipo de datos)",
"wikibase-description-helppage": "Help:Descripción",
"wikibase-label-helppage": "Help:Etiqueta",
"special-newitem": "Crear un elemento nuevo",
@@ -312,7 +316,7 @@
"wikibase-entitydata-unsupported-format": "El formato de datos $1 no es
compatible con esta interfaz.",
"wikibase-entitydata-storage-error": "No se pudo cargar la entidad $1.",
"wikibase-entitydata-title": "Datos de la entidad",
- "wikibase-entitydata-text": "Esta página proporciona una interfaz de
datos enlazados con valores de entidades. Proporciona el identificador de la
entidad en el URL mediante la sintaxis de subpáginas.\n* Se aplicará la
negociación de contenidos según la cabecera «Accept» de tu cliente. En otras
palabras, los datos de la entidad se proporcionarán en el formato que tu
cliente prefiera. Para un navegador web, este será HTML, que provocará que el
navegador se redirija a la página normal de la entidad.\n* Es posible solicitar
explícitamente un formato de datos específico si añades la extensión de archivo
apropiada al identificador de entidad: «Q23.json» devolverá los datos en el
formato JSON, «Q23.ttl» lo hará en RDF/Turtle, etcétera.",
+ "wikibase-entitydata-text": "Esta página proporciona una interfaz de
datos vinculada a los valores de entidad. Proporcione el ID de la entidad en la
URL, utilizando la sintaxis de la subpágina.\n* La negociación de contenido se
aplica en función del encabezado de Aceptación del cliente. Esto significa que
los datos de la entidad serán proporcionados en el formato preferido por su
cliente. Para un navegador web, esto será HTML, haciendo que su navegador sea
redirigido a la página regular de la entidad.\n* Puede solicitar explícitamente
un formato de datos específico agregando la extensión de archivo apropiada al
ID de entidad: Q23.json retornará datos en el formato JSON, Q23.ttl retornará
RDF/Turtle, y así sucesivamente. Los formatos admitidos son: $1.",
"special-entitypage": "Página de entidad",
"wikibase-entitypage-title": "Página de entidad",
"wikibase-entitypage-bad-id": "Identificador no válido: $1.",
@@ -335,6 +339,7 @@
"wikibase-restoreold": "restaurar",
"wikibase-entity-summary-restore": "Se restauró la revisión $3 de
[[Special:Contributions/$4|{{GENDER:$4|$4}}]]",
"wikibase-entity-summary-undo": "Se ha deshecho la revisión $3 de
[[Special:Contributions/$4|{{GENDER:$4|$4}}]] ([[User talk:$4|disc.]])",
+ "wikibase-non-entity-diff": "No se puede comparar una entidad con un
contenido distinto de la entidad.",
"wikibase-no-direct-editing": "La edición directa está desactivada en
el espacio de nombres $1",
"wikibase-noentity": "Esta entidad no existe. Puedes
[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} buscar en los registros
relacionados] para encontrarla.",
"wikibase-noentity-createone": "También puedes [[$1|crear una nueva]].",
diff --git a/extensions/Wikibase/repo/i18n/fr.json
b/extensions/Wikibase/repo/i18n/fr.json
index 7776887..c6f1fc8 100644
--- a/extensions/Wikibase/repo/i18n/fr.json
+++ b/extensions/Wikibase/repo/i18n/fr.json
@@ -220,6 +220,7 @@
"wikibase-newproperty-datatype": "Type de données:",
"wikibase-newproperty-invalid-datatype": "Type de données spécifié non
valide.",
"wikibase-newproperty-insufficient-data": "Vous devez remplir au moins
soit l'étiquette, soit la description ou bien les alias.",
+ "wikibase-newproperty-pick-data-type": "(choisir un type de donnée)",
"wikibase-description-helppage": "Help:Description",
"wikibase-label-helppage": "Help:Label",
"special-newitem": "Créer un nouvel élément",
@@ -362,6 +363,7 @@
"wikibase-restoreold": "restaurer",
"wikibase-entity-summary-restore": "Restauration de la révision $3 par
[[Special:Contributions/$4|{{GENDER:$4|$4}}]]",
"wikibase-entity-summary-undo": "Annulation de la révision $3 par
[[Special:Contributions/$4|{{GENDER:$4|$4}}]] ([[User talk:$4|talk]])",
+ "wikibase-non-entity-diff": "Impossible de comparer une entité avec un
contenu non entité.",
"wikibase-no-direct-editing": "La modification directe est désactivée
dans l'espace $1",
"wikibase-noentity": "Cette entité n’existe pas. Vous pouvez
[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} rechercher dans les
journaux concernés]</span> pour savoir où elle est allée.",
"wikibase-noentity-createone": "Vous pouvez aussi [[$1|en créer une
nouvelle]].",
diff --git a/extensions/Wikibase/repo/i18n/gl.json
b/extensions/Wikibase/repo/i18n/gl.json
index 2f12d9f..7021a0b 100644
--- a/extensions/Wikibase/repo/i18n/gl.json
+++ b/extensions/Wikibase/repo/i18n/gl.json
@@ -125,7 +125,7 @@
"wikibase-validator-label-with-description-conflict": "O elemento $3 xa
ten a etiqueta \"$1\" asociada ao código de lingua $2, co mesmo texto de
descrición.",
"wikibase-validator-label-no-entityid": "A etiqueta non pode ser un
identificador de entidade válido.",
"wikibase-validator-illegal-file-chars": "Os nomes de ficheiro non
poden levar caracteres como comas ou barras inclinadas. Por favor, engada só o
nome despois de \"File:\".",
- "wikibase-validator-illegal-geo-shape-title": "O valor debe comezar con
\"Data:\" e rematar con \".map\". Adicionalmente o título non debería conter
caracteres como coma, # ou a barra vertical(|).",
+ "wikibase-validator-illegal-geo-shape-title": "O valor debe comezar con
<code>Data:</code> e rematar con <code>.map</code>. Adicionalmente o título non
debería conter caracteres como coma, # ou a barra vertical(|).",
"wikibase-validator-no-such-media": "O ficheiro \"$1\" non existe en
[https://commons.wikimedia.org/ Wikimedia Commons].",
"wikibase-validator-no-such-sitelink": "Non se puido atopar a ligazón
de sitio a \"$1\" ó tentar editar identificacións.",
"wikibase-validator-page-not-exists": "A páxina \"$1\" non existe.",
@@ -176,6 +176,7 @@
"wikibase-newproperty-datatype": "Tipo de datos:",
"wikibase-newproperty-invalid-datatype": "O tipo de datos especificado
non é válido.",
"wikibase-newproperty-insufficient-data": "Necesita indicar polo menos
a etiqueta, a descrición ou os alias.",
+ "wikibase-newproperty-pick-data-type": "(elixir un tipo de datos)",
"wikibase-description-helppage": "Help:Descricións",
"wikibase-label-helppage": "Help:Etiquetas",
"special-newitem": "Crear un novo elemento",
@@ -318,6 +319,7 @@
"wikibase-restoreold": "restaurar",
"wikibase-entity-summary-restore": "Restauro a revisión $3 feita por
[[Special:Contributions/$4|{{GENDER:$4|$4}}]]",
"wikibase-entity-summary-undo": "Desfacer a modificación $3 de
[[Special:Contributions/$4|{{GENDER:$4|$4}}]] ([[User talk:$4|talk]])",
+ "wikibase-non-entity-diff": "Non se pode comparar unha entidade cun
contido que non é unha entidade.",
"wikibase-no-direct-editing": "A edición directa está desactivada no
espazo de nomes \"$1\"",
"wikibase-noentity": "Esta entidade non existe.
Pode\n[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} procurar nos
rexistros relacionados] para descubrir onde foi parar.",
"wikibase-noentity-createone": "Tamén pode [[$1|crear un novo]].",
@@ -333,6 +335,7 @@
"wikibase-listdatatypes-geo-shape-head": "Forma xeográfica",
"wikibase-listdatatypes-geo-shape-body": "Ligazón ós datos de mapa
xeográfico almacenados en Wikimedia Commons (ou outra wiki configurada).
Consulte \"https://www.mediawiki.org/wiki/Help:Map_Data\" para atopar máis
documentación sobre datos de mapas.",
"wikibase-listdatatypes-tabular-data-head": "Datos tabulares",
+ "wikibase-listdatatypes-tabular-data-body": "Ligazón ós datos tabulados
almacenados en Wikimedia Commons (ou outro wiki configurado). Consulte
\"https://www.mediawiki.org/wiki/Help:Tabular_Data\" para obter máis
documentación sobre os datos tabulares.",
"wikibase-listdatatypes-quantity-head": "Cantidade",
"wikibase-listdatatypes-quantity-body": "Campo de datos literal para
unha cantidade relacionada con algún tipo de unidade ben definida. A unidade
real vai nos valores de datos introducidos.\n* amount – parte implícita da
cadea de texto (o mapeamento do prefixo da unidade non está claro)\n* unit –
parte implícita da cadea de texto con valor por defecto \"1\" (o mapeamento ao
corpo estandarizante non está claro)\n* upperbound - límite superior da
cantidade \n* lowerbound - límite inferior da cantidade",
"wikibase-listdatatypes-monolingualtext-head": "Texto monolingüe",
diff --git a/extensions/Wikibase/repo/i18n/he.json
b/extensions/Wikibase/repo/i18n/he.json
index 528d7e3..2216f7b 100644
--- a/extensions/Wikibase/repo/i18n/he.json
+++ b/extensions/Wikibase/repo/i18n/he.json
@@ -129,8 +129,8 @@
"wikibase-validator-label-with-description-conflict": "לפריט $3 כבר יש
תווית \"$1\" שמשויכת לקוד השפה $2, שמשתמשת באותו הטקסט בתיאור.",
"wikibase-validator-label-no-entityid": "התווית הזאת אינה צריכה להיות
מזהה ישות תקין.",
"wikibase-validator-illegal-file-chars": "שמות קבצים לא יכולים להכיל
תווים מסוימים, כמו נקודתיים וקווים נטויים. יש להדביק את שם הקובץ רק אחרי
\"File:\".",
- "wikibase-validator-illegal-geo-shape-title": "ערכים צריכים להתחיל
ב־\"Data:\" ולהסתיים ב־\".map\". בנוסף, הכותרת צריכה לא להכיל תווים כמו
נקודתיים, סולמית, או מקל.",
- "wikibase-validator-illegal-tabular-data-title": "נתונים צריכים להתחיל
ב־\"Data:\" ולהסתיים ב־\".tab\". בנוסף, הכותרת צריכה לא להכיל תווים כמו
נקודתיים, סולמית, או מקל.",
+ "wikibase-validator-illegal-geo-shape-title": "ערכים צריכים להתחיל
ב־<code dir=\"ltr\">Data:</code> ולהסתיים ב־<code dir=\"ltr\">.map</code>.
בנוסף, הכותרת צריכה לא להכיל תווים כמו נקודתיים, סולמית, או מקל.",
+ "wikibase-validator-illegal-tabular-data-title": "נתונים צריכים להתחיל
ב־\"<code dir=\"ltr\">Data:</code>\" ולהסתיים ב־\"<code
dir=\"ktr\">.tab</code>\". בנוסף, הכותרת צריכה לא להכיל תווים כמו נקודתיים,
סולמית, או מקל.",
"wikibase-validator-no-such-media": "הקובץ \"$1\" אינו קיים
ב־[https://commons.wikimedia.org/ ויקישיתוף]",
"wikibase-validator-no-such-sitelink": "לא היה אפשר למצוא קישור אתר אל
\"$1\" בלי לנסות לערוך סמלים.",
"wikibase-validator-page-not-exists": "הדף \"$1\" אינו קיים.",
@@ -181,6 +181,7 @@
"wikibase-newproperty-datatype": "סוג נתונים:",
"wikibase-newproperty-invalid-datatype": "צוין סוג נתונים בלתיֹ־תקין.",
"wikibase-newproperty-insufficient-data": "חובה למלא לפחות תווית, תיאור
או כינויים.",
+ "wikibase-newproperty-pick-data-type": "(נא לבחור סוג נתונים)",
"wikibase-description-helppage": "Help:תיאור",
"wikibase-label-helppage": "Help:תווית",
"special-newitem": "יצירת פריט חדש",
@@ -323,6 +324,7 @@
"wikibase-restoreold": "איפוס",
"wikibase-entity-summary-restore": "שחזור גרסה $3 מאת
[[Special:Contributions/$4|{{GENDER:$4|$4}}]]",
"wikibase-entity-summary-undo": "ביטול גרסה $3 של
[[Special:Contributions/$4|{{GENDER:$4|$4}}]] ([[User talk:$4|שיחה]])",
+ "wikibase-non-entity-diff": "לא ניתן להשוות ישות עם תוכן שאינו ישות.",
"wikibase-no-direct-editing": "עריכה ישירה כבויה במרחב השם $1",
"wikibase-noentity": "הישות הזאת אינה קיימת. ביכולתך
[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} לחפש ביומנים הקשורים] כדי
למצוא לאן היא הלכה.",
"wikibase-noentity-createone": "אפשר גם [[$1|ליצור אחת חדשה]].",
diff --git a/extensions/Wikibase/repo/i18n/lv.json
b/extensions/Wikibase/repo/i18n/lv.json
index fd5fe10..549937f 100644
--- a/extensions/Wikibase/repo/i18n/lv.json
+++ b/extensions/Wikibase/repo/i18n/lv.json
@@ -98,6 +98,7 @@
"wikibase-itemdisambiguation-search": "Tu vari [$1 meklēt vienumu].",
"wikibase-itemdisambiguation-create": "Tu vari [$1 izveidot vienumu].",
"wikibase-newproperty-datatype": "Datu tips:",
+ "wikibase-newproperty-pick-data-type": "(izvēlies datu tipu)",
"wikibase-description-helppage": "Help:Apraksts",
"wikibase-label-helppage": "Help:Nosaukums",
"special-newitem": "Izveido jaunu ierakstu",
@@ -155,6 +156,7 @@
"wikibase-listdatatypes-wikibase-item-head": "Vienums",
"wikibase-listdatatypes-globe-coordinate-head": "Ģeogrāfiskās
koordinātas",
"wikibase-listdatatypes-geo-shape-head": "Ģeogrāfiska forma",
+ "wikibase-listdatatypes-tabular-data-head": "Tabulāri dati",
"wikibase-listdatatypes-quantity-head": "Daudzums",
"wikibase-listdatatypes-time-head": "Laiks",
"wikibase-listdatatypes-url-head": "URL",
diff --git a/extensions/Wikibase/repo/i18n/qqq.json
b/extensions/Wikibase/repo/i18n/qqq.json
index bae98a6..26aeac5 100644
--- a/extensions/Wikibase/repo/i18n/qqq.json
+++ b/extensions/Wikibase/repo/i18n/qqq.json
@@ -162,8 +162,8 @@
"wikibase-validator-label-with-description-conflict": "Error message
shown when a user tries to save an item that has a non-unique label+description
pair.\n\nParameters:\n* $1 - label text\n* $2 - the label's language code\n* $3
- the id of the item that already has the label and the description\nSee
also:\n* {{msg-mw|Wikibase-validator-label-conflict}}",
"wikibase-validator-label-no-entityid": "Error message shown when a
user tries to save an item that has a valid entity id as label. Parameters:\n*
$1 is the label.",
"wikibase-validator-illegal-file-chars": "Validator error message shown
when a user tries to link to a Wikimedia Commons media file, but the file name
contains illegal special characters such as slashes or colons.",
- "wikibase-validator-illegal-geo-shape-title": "Validator error message
shown when a user tries to link to a geo-shape page, but the page title
contains illegal special characters such as hash.",
- "wikibase-validator-illegal-tabular-data-title": "Validator error
message shown when a user tries to link to a tabular-data page, but the page
title contains illegal special characters such as hash.",
+ "wikibase-validator-illegal-geo-shape-title": "{{doc-important|Do not
translate \"Data:\" and \".tab\". When translating to a right-to-left language,
use <code><nowiki><code dir=\"ltr\"></nowiki></code>.}}\nValidator error
message shown when a user tries to link to a geo-shape page, but the page title
contains illegal special characters such as hash.",
+ "wikibase-validator-illegal-tabular-data-title": "{{doc-important|Do
not translate both \"Data:\" and \".tab\". When translating to a right-to-left
language, use <code><nowiki><code dir=\"ltr\"></nowiki></code>.}}\nValidator
error message shown when a user tries to link to a tabular-data page, but the
page title contains illegal special characters such as hash.",
"wikibase-validator-no-such-media": "Error message shown when a user
tries to add a link to a Wikimedia Commons media file which does not exist.
Parameters:\n* $1 is the name of the file.",
"wikibase-validator-no-such-sitelink": "Error message shown when a user
tries to edit a badges for the site on which the item has no sitelink.
Parameters:\n* $1 - the site id\n\nSee also:\n*
{{msg-mw|wikibase-api-no-such-sitelink}}",
"wikibase-validator-page-not-exists": "Error message shown when a user
tries to add a link to a Wiki page which does not exist. Parameters:\n* $1 is
the name of the page.",
diff --git a/extensions/Wikibase/repo/i18n/zh-hans.json
b/extensions/Wikibase/repo/i18n/zh-hans.json
index ba87015..65139a1 100644
--- a/extensions/Wikibase/repo/i18n/zh-hans.json
+++ b/extensions/Wikibase/repo/i18n/zh-hans.json
@@ -141,8 +141,8 @@
"wikibase-validator-label-with-description-conflict":
"项$3已经关联语言代码$2的标签“$1”,使用同一描述文本。",
"wikibase-validator-label-no-entityid": "该标签不是有效的实体ID。",
"wikibase-validator-illegal-file-chars":
"文件名不允许保护冒号或斜杠字符。请只粘贴“File:”之后的文件名。",
- "wikibase-validator-illegal-geo-shape-title":
"值必须以“Data:”开头,并以“.map”结尾。另外标题不应包含冒号、哈希或管道字符。",
- "wikibase-validator-illegal-tabular-data-title":
"值必须以“Data:”开头,并以“.tab”结尾。另外标题不应包含冒号、哈希或管道字符。",
+ "wikibase-validator-illegal-geo-shape-title":
"值必须以<code>Data:</code>开头,并以<code>.map</code>结尾。另外标题不应包含冒号、哈希或管道字符。",
+ "wikibase-validator-illegal-tabular-data-title":
"值必须以<code>Data:</code>开头,并以<code>.tab</code>结尾。另外标题不应包含冒号、哈希或管道字符。",
"wikibase-validator-no-such-media":
"文件“$1”在[https://commons.wikimedia.org/ 维基共享资源]不存在。",
"wikibase-validator-no-such-sitelink": "尝试编辑徽章时无法找到至“$1”的网站链接。",
"wikibase-validator-page-not-exists": "页面“$1”不存在。",
@@ -196,6 +196,7 @@
"wikibase-newproperty-datatype": "数据类型:",
"wikibase-newproperty-invalid-datatype": "指定的数据类型无效。",
"wikibase-newproperty-insufficient-data": "您需要至少填写标签、描述或别名。",
+ "wikibase-newproperty-pick-data-type": "(选择数据类型)",
"wikibase-description-helppage": "Help:描述",
"wikibase-label-helppage": "Help:标签",
"special-newitem": "创建新项",
@@ -338,6 +339,7 @@
"wikibase-restoreold": "还原",
"wikibase-entity-summary-restore":
"还原[[Special:Contributions/$4|{{GENDER:$4|$4}}]]的版本$3",
"wikibase-entity-summary-undo":
"撤销[[Special:Contributions/$4|{{GENDER:$4|$4}}]]([[User talk:$4|讨论]])的版本$3",
+ "wikibase-non-entity-diff": "不能比较实体与非实体内容之间的差异。",
"wikibase-no-direct-editing": "名字空间$1禁止直接编辑",
"wikibase-noentity":
"本实体不存在。您可以[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} 搜索相关日志]了解其去向。",
"wikibase-noentity-createone": "您也可以[[$1|创建新数据集]]。",
diff --git a/extensions/Wikibase/repo/includes/Content/ItemContent.php
b/extensions/Wikibase/repo/includes/Content/ItemContent.php
index 2789569..5f9d42e 100644
--- a/extensions/Wikibase/repo/includes/Content/ItemContent.php
+++ b/extensions/Wikibase/repo/includes/Content/ItemContent.php
@@ -147,13 +147,6 @@
}
/**
- * @return self
- */
- public static function newEmpty() {
- return new static( new EntityInstanceHolder( new Item() ) );
- }
-
- /**
* @see EntityContent::getEntity
*
* @throws MWException when it's a redirect (targets will never be
resolved)
diff --git a/extensions/Wikibase/repo/includes/Specials/SpecialNewProperty.php
b/extensions/Wikibase/repo/includes/Specials/SpecialNewProperty.php
index 66deef5..3521f8e 100644
--- a/extensions/Wikibase/repo/includes/Specials/SpecialNewProperty.php
+++ b/extensions/Wikibase/repo/includes/Specials/SpecialNewProperty.php
@@ -125,9 +125,6 @@
'options' => array_merge( $options,
$selector->getOptionsArray() ),
'id' => 'wb-newproperty-datatype',
'validation-callback' => function ( $dataType,
$formData, $form ) {
- if ( $dataType === '' ) {
- return false;
- }
if ( !$this->dataTypeExists( $dataType ) ) {
return [ $this->msg(
'wikibase-newproperty-invalid-datatype' )->text() ];
}
diff --git
a/extensions/Wikibase/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
b/extensions/Wikibase/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
index 075aa94..1fc6a79 100644
---
a/extensions/Wikibase/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
+++
b/extensions/Wikibase/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
@@ -5,6 +5,7 @@
use InvalidArgumentException;
use Wikibase\ChangeOp\ChangeOpAliases;
use Wikibase\ChangeOp\ChangeOpException;
+use Wikibase\Content\EntityInstanceHolder;
use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\Item;
use Wikibase\ItemContent;
@@ -55,7 +56,7 @@
$enAliases = array( 'en-alias1', 'en-alias2', 'en-alias3' );
$existingEnAliases = array( 'en-existingAlias1',
'en-existingAlias2' );
- $itemContent = ItemContent::newEmpty();
+ $itemContent = new ItemContent( new EntityInstanceHolder( new
Item() ) );
$item = $itemContent->getEntity();
$item->setAliases( 'en', $existingEnAliases );
diff --git
a/extensions/Wikibase/repo/tests/phpunit/includes/Content/ItemContentTest.php
b/extensions/Wikibase/repo/tests/phpunit/includes/Content/ItemContentTest.php
index 8f353e8..86a357b 100644
---
a/extensions/Wikibase/repo/tests/phpunit/includes/Content/ItemContentTest.php
+++
b/extensions/Wikibase/repo/tests/phpunit/includes/Content/ItemContentTest.php
@@ -66,7 +66,7 @@
* @return ItemContent
*/
protected function newEmpty( EntityId $itemId = null ) {
- $empty = ItemContent::newEmpty();
+ $empty = new ItemContent( new EntityInstanceHolder( new Item()
) );
if ( $itemId !== null ) {
$empty->getItem()->setId( $itemId );
diff --git
a/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
b/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
index b65730e..70f6000 100644
---
a/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
+++
b/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
@@ -9,6 +9,7 @@
use Status;
use Title;
use User;
+use Wikibase\Content\EntityInstanceHolder;
use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Entity\EntityRedirect;
@@ -57,11 +58,11 @@
$entityContentFactory->expects( $this->any() )
->method( 'newFromEntity' )
->with( $this->isInstanceOf( EntityDocument::class ) )
- ->will( $this->returnValue( ItemContent::newEmpty() ) );
+ ->will( $this->returnValue( new ItemContent( new
EntityInstanceHolder( new Item() ) ) ) );
$entityContentFactory->expects( $this->any() )
->method( 'newFromRedirect' )
->with( $this->isInstanceOf( EntityRedirect::class ) )
- ->will( $this->returnValue( ItemContent::newEmpty() ) );
+ ->will( $this->returnValue( new ItemContent( new
EntityInstanceHolder( new Item() ) ) ) );
return new EditFilterHookRunner(
$namespaceLookup,
@@ -168,7 +169,7 @@
$this->assertEquals( $expected['title'],
$context->getTitle()->getFullText() );
$this->assertSame( $context->getTitle(),
$context->getWikiPage()->getTitle() );
$this->assertEquals( $expected['namespace'],
$context->getTitle()->getNamespace() );
- $this->assertEquals( ItemContent::newEmpty(),
$content );
+ $this->assertEquals( new ItemContent( new
EntityInstanceHolder( new Item() ) ), $content );
$this->assertTrue( $status->isGood() );
$this->assertTrue( is_string( $summary ) );
$this->assertEquals(
'EditFilterHookRunnerTestUser', $user->getName() );
diff --git
a/extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialNewPropertyTest.php
b/extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialNewPropertyTest.php
index 327bdf5..d6fda6b 100644
---
a/extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialNewPropertyTest.php
+++
b/extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialNewPropertyTest.php
@@ -214,7 +214,7 @@
SpecialNewProperty::FIELD_LABEL =>
'empty datatype label',
SpecialNewProperty::FIELD_DESCRIPTION
=> 'desc',
SpecialNewProperty::FIELD_ALIASES =>
'a1|a2',
- SpecialNewProperty::FIELD_DATATYPE => '
',
+ SpecialNewProperty::FIELD_DATATYPE =>
'',
],
'Invalid data type specified',
],
diff --git a/extensions/Wikibase/view/tests/phpunit/ClaimHtmlGeneratorTest.php
b/extensions/Wikibase/view/tests/phpunit/ClaimHtmlGeneratorTest.php
index 46ff82b..18fd490 100644
--- a/extensions/Wikibase/view/tests/phpunit/ClaimHtmlGeneratorTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/ClaimHtmlGeneratorTest.php
@@ -40,8 +40,7 @@
->disableOriginalConstructor()
->getMock();
- $snakHtmlGenerator->expects( $this->any() )
- ->method( 'getSnakHtml' )
+ $snakHtmlGenerator->method( 'getSnakHtml' )
->will( $this->returnValue( 'SNAK HTML' ) );
return $snakHtmlGenerator;
diff --git
a/extensions/Wikibase/view/tests/phpunit/Module/TemplateModuleTest.php
b/extensions/Wikibase/view/tests/phpunit/Module/TemplateModuleTest.php
index cf853af..8eb1fd4 100644
--- a/extensions/Wikibase/view/tests/phpunit/Module/TemplateModuleTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/Module/TemplateModuleTest.php
@@ -59,8 +59,7 @@
$context = $this->getMockBuilder( ResourceLoaderContext::class )
->disableOriginalConstructor()
->getMock();
- $context->expects( $this->any() )
- ->method( 'getLanguage' )
+ $context->method( 'getLanguage' )
->will( $this->returnValue( 'en' ) );
return $context;
diff --git
a/extensions/Wikibase/view/tests/phpunit/SimpleEntityTermsViewTest.php
b/extensions/Wikibase/view/tests/phpunit/SimpleEntityTermsViewTest.php
index 5a21456..080f621 100644
--- a/extensions/Wikibase/view/tests/phpunit/SimpleEntityTermsViewTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/SimpleEntityTermsViewTest.php
@@ -47,15 +47,13 @@
->getMock();
$htmlTermRenderer = $this->getMock( HtmlTermRenderer::class );
- $htmlTermRenderer->expects( $this->any() )
- ->method( 'renderTerm' )
+ $htmlTermRenderer->method( 'renderTerm' )
->will( $this->returnCallback( function( Term $term ) {
return htmlspecialchars( $term->getText() );
} ) );
$labelDescriptionLookup = $this->getMock(
LabelDescriptionLookup::class );
- $labelDescriptionLookup->expects( $this->any() )
- ->method( 'getLabel' )
+ $labelDescriptionLookup->method( 'getLabel' )
->will( $this->returnCallback( function( EntityId
$entityId ) {
$terms = [
'Q111' => new Term( 'language',
'<LABEL>' ),
@@ -63,8 +61,7 @@
];
return isset( $terms[
$entityId->getSerialization() ] ) ? $terms[ $entityId->getSerialization() ] :
null;
} ) );
- $labelDescriptionLookup->expects( $this->any() )
- ->method( 'getDescription' )
+ $labelDescriptionLookup->method( 'getDescription' )
->will( $this->returnCallback( function( EntityId
$entityId ) {
return $entityId->getSerialization() === 'Q111'
? new Term( 'language', '<DESCRIPTION>' ) : null;
} ) );
diff --git a/extensions/Wikibase/view/tests/phpunit/SiteLinksViewTest.php
b/extensions/Wikibase/view/tests/phpunit/SiteLinksViewTest.php
index e10479f..0e65c70 100644
--- a/extensions/Wikibase/view/tests/phpunit/SiteLinksViewTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/SiteLinksViewTest.php
@@ -139,8 +139,7 @@
) ) );
$languageNameLookup = $this->getMock( LanguageNameLookup::class
);
- $languageNameLookup->expects( $this->any() )
- ->method( 'getName' )
+ $languageNameLookup->method( 'getName' )
->will( $this->returnValue( '<LANG>' ) );
return new SiteLinksView(
@@ -161,8 +160,7 @@
private function newNumberLocalizer() {
$numberLocalizer = $this->getMock( NumberLocalizer::class );
- $numberLocalizer->expects( $this->any() )
- ->method( 'localizeNumber' )
+ $numberLocalizer->method( 'localizeNumber' )
->will( $this->returnCallback( 'strval' ) );
return $numberLocalizer;
}
@@ -198,8 +196,7 @@
private function newEntityIdFormatter() {
$formatter = $this->getMock( EntityIdFormatter::class );
- $formatter->expects( $this->any() )
- ->method( 'formatEntityId' )
+ $formatter->method( 'formatEntityId' )
->will( $this->returnCallback( function( EntityId $id )
{
if ( $id->getSerialization() === 'Q42' ) {
return 'Featured article';
diff --git
a/extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
b/extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
index 75d693b..1e3c42b 100644
--- a/extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
@@ -156,8 +156,7 @@
private function getPropertyOrderProvider() {
$propertyOrderProvider = $this->getMock(
PropertyOrderProvider::class );
- $propertyOrderProvider->expects( $this->any() )
- ->method( 'getPropertyOrder' )
+ $propertyOrderProvider->method( 'getPropertyOrder' )
->will( $this->returnValue( [
'P101' => 0,
'P102' => 1,
@@ -175,8 +174,7 @@
->disableOriginalConstructor()
->getMock();
- $claimHtmlGenerator->expects( $this->any() )
- ->method( 'getHtmlForClaim' )
+ $claimHtmlGenerator->method( 'getHtmlForClaim' )
->will( $this->returnCallback( function( Statement
$statement, $editSectionHtml = null ) {
return $statement->getGuid() . "\n";
} ) );
@@ -190,8 +188,7 @@
private function getEntityIdFormatter() {
$entityIdFormatter = $this->getMock( EntityIdFormatter::class );
- $entityIdFormatter->expects( $this->any() )
- ->method( 'formatEntityId' )
+ $entityIdFormatter->method( 'formatEntityId' )
->will( $this->returnValue( '<ID>' ) );
return $entityIdFormatter;
diff --git
a/extensions/Wikibase/view/tests/phpunit/StatementSectionsViewTest.php
b/extensions/Wikibase/view/tests/phpunit/StatementSectionsViewTest.php
index b59f896..f44eec5 100644
--- a/extensions/Wikibase/view/tests/phpunit/StatementSectionsViewTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/StatementSectionsViewTest.php
@@ -34,15 +34,13 @@
) ) );
$statementGrouper = $this->getMock( StatementGrouper::class );
- $statementGrouper->expects( $this->any() )
- ->method( 'groupStatements' )
+ $statementGrouper->method( 'groupStatements' )
->will( $this->returnValue( $statementLists ) );
$statementListView = $this->getMockBuilder(
StatementGroupListView::class )
->disableOriginalConstructor()
->getMock();
- $statementListView->expects( $this->any() )
- ->method( 'getHtml' )
+ $statementListView->method( 'getHtml' )
->will( $this->returnValue( '<LIST>' ) );
return new StatementSectionsView(
diff --git a/extensions/Wikibase/view/tests/phpunit/TermsListViewTest.php
b/extensions/Wikibase/view/tests/phpunit/TermsListViewTest.php
index 329dd0a..41599ae 100644
--- a/extensions/Wikibase/view/tests/phpunit/TermsListViewTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/TermsListViewTest.php
@@ -43,8 +43,7 @@
} ) );
$languageDirectionalityLookup = $this->getMock(
LanguageDirectionalityLookup::class );
- $languageDirectionalityLookup->expects( $this->any() )
- ->method( 'getDirectionality' )
+ $languageDirectionalityLookup->method( 'getDirectionality' )
->will( $this->returnCallback( function( $languageCode
) {
return [
'en' => 'ltr',
@@ -157,8 +156,7 @@
public function testGetTermsListView_isEscaped() {
$textProvider = $this->getMock( LocalizedTextProvider::class );
- $textProvider->expects( $this->any() )
- ->method( 'get' )
+ $textProvider->method( 'get' )
->will( $this->returnCallback( function( $key ) {
return $key ===
'wikibase-entitytermsforlanguagelistview-language' ? '"RAW"' : "($key)";
} ) );
diff --git
a/extensions/Wikibase/view/tests/phpunit/ToolbarEditSectionGeneratorTest.php
b/extensions/Wikibase/view/tests/phpunit/ToolbarEditSectionGeneratorTest.php
index 13642c2..306f1fb 100644
--- a/extensions/Wikibase/view/tests/phpunit/ToolbarEditSectionGeneratorTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/ToolbarEditSectionGeneratorTest.php
@@ -105,8 +105,7 @@
private function newToolbarEditSectionGenerator() {
$specialPageLinker = $this->getMock( SpecialPageLinker::class );
- $specialPageLinker->expects( $this->any() )
- ->method( 'getLink' )
+ $specialPageLinker->method( 'getLink' )
->will( $this->returnCallback( function( $specialPage,
$params = array() ) {
return 'Special:' . $specialPage . '/' .
implode( '/', $params );
} ) );
diff --git a/extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
b/extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
index c8727cf..1b1f965 100644
--- a/extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
@@ -154,12 +154,10 @@
$formatterFactory = $this->getMock(
EntityIdFormatterFactory::class );
- $formatterFactory->expects( $this->any() )
- ->method( 'getOutputFormat' )
+ $formatterFactory->method( 'getOutputFormat' )
->will( $this->returnValue( $format ) );
- $formatterFactory->expects( $this->any() )
- ->method( 'getEntityIdFormatter' )
+ $formatterFactory->method( 'getEntityIdFormatter' )
->will( $this->returnValue( $entityIdFormatter ) );
return $formatterFactory;
@@ -171,14 +169,12 @@
private function getSnakFormatterFactory() {
$snakFormatter = $this->getMock( SnakFormatter::class );
- $snakFormatter->expects( $this->any() )
- ->method( 'getFormat' )
+ $snakFormatter->method( 'getFormat' )
->will( $this->returnValue( SnakFormatter::FORMAT_HTML
) );
$snakFormatterFactory = $this->getMock(
HtmlSnakFormatterFactory::class );
- $snakFormatterFactory->expects( $this->any() )
- ->method( 'getSnakFormatter' )
+ $snakFormatterFactory->method( 'getSnakFormatter' )
->will( $this->returnValue( $snakFormatter ) );
return $snakFormatterFactory;
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 4641fa1..5957e3b 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1365,12 +1365,12 @@
"source": {
"type": "git",
"url":
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git",
- "reference": "52253d5b116df36849b2c44f787cbe3f256fedd2"
+ "reference": "79219df1c2bd05cf006c0d3da1e8bcda9d38a491"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/52253d5b116df36849b2c44f787cbe3f256fedd2",
- "reference": "52253d5b116df36849b2c44f787cbe3f256fedd2",
+ "url":
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/79219df1c2bd05cf006c0d3da1e8bcda9d38a491",
+ "reference": "79219df1c2bd05cf006c0d3da1e8bcda9d38a491",
"shasum": ""
},
"require": {
@@ -1402,7 +1402,7 @@
"jakub-onderka/php-parallel-lint": ">=0.3 <0.10",
"mediawiki/mediawiki-codesniffer": ">=0.7 <0.8"
},
- "time": "2017-04-24 21:02:21",
+ "time": "2017-04-26 07:39:03",
"type": "mediawiki-extension",
"installation-source": "dist",
"autoload": {
@@ -1787,7 +1787,7 @@
"source": {
"type": "git",
"url":
"https://gerrit.wikimedia.org/r/mediawiki/extensions/WikibaseQualityConstraints",
- "reference": "3fe99d70424d8e912a622fd60d5ce6ce506864af"
+ "reference": "e93fb8974e2005af0301e96ef9cd2dd492a7ee23"
},
"require": {
"php": ">=5.5.9",
@@ -1800,7 +1800,7 @@
"phpunit/phpunit": "^3.7.37|~4.5",
"satooshi/php-coveralls": "master-dev"
},
- "time": "2017-04-24 21:02:54",
+ "time": "2017-04-26 07:08:29",
"type": "mediawiki-extension",
"installation-source": "source",
"autoload": {
--
To view, visit https://gerrit.wikimedia.org/r/350385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I46da7fedb9e39727ffd4cf328a1b5aa6b29faa58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata
Gerrit-Branch: master
Gerrit-Owner: WikidataBuilder <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits