src/ConstraintCheck/Checker/ContemporaryChecker.php 1 location
|
@@ 102-108 (lines=7) @@
|
| 99 |
|
// nothing to check |
| 100 |
|
return new CheckResult( $context, $constraint, [], CheckResult::STATUS_COMPLIANCE ); |
| 101 |
|
} |
| 102 |
|
if ( $snak->getDataValue()->getType() !== 'wikibase-entityid' ) { |
| 103 |
|
// wrong data type |
| 104 |
|
$message = ( new ViolationMessage( 'wbqc-violation-message-value-needed-of-type' ) ) |
| 105 |
|
->withEntityId( new ItemId( $constraint->getConstraintTypeItemId() ), Role::CONSTRAINT_TYPE_ITEM ) |
| 106 |
|
->withDataValueType( 'wikibase-entityid' ); |
| 107 |
|
return new CheckResult( $context, $constraint, [], CheckResult::STATUS_VIOLATION, $message ); |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
/** @var EntityId $objectId */ |
| 111 |
|
$objectId = $snak->getDataValue()->getEntityId(); |
src/ConstraintCheck/Checker/InverseChecker.php 1 location
|
@@ 110-115 (lines=6) @@
|
| 107 |
|
* error handling: |
| 108 |
|
* type of $dataValue for properties with 'Inverse' constraint has to be 'wikibase-entityid' |
| 109 |
|
*/ |
| 110 |
|
if ( $dataValue->getType() !== 'wikibase-entityid' ) { |
| 111 |
|
$message = ( new ViolationMessage( 'wbqc-violation-message-value-needed-of-type' ) ) |
| 112 |
|
->withEntityId( new ItemId( $constraint->getConstraintTypeItemId() ), Role::CONSTRAINT_TYPE_ITEM ) |
| 113 |
|
->withDataValueType( 'wikibase-entityid' ); |
| 114 |
|
return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message ); |
| 115 |
|
} |
| 116 |
|
/** @var EntityIdValue $dataValue */ |
| 117 |
|
|
| 118 |
|
$targetEntityId = $dataValue->getEntityId(); |
src/ConstraintCheck/Checker/SymmetricChecker.php 1 location
|
@@ 97-102 (lines=6) @@
|
| 94 |
|
* error handling: |
| 95 |
|
* type of $dataValue for properties with 'Symmetric' constraint has to be 'wikibase-entityid' |
| 96 |
|
*/ |
| 97 |
|
if ( $dataValue->getType() !== 'wikibase-entityid' ) { |
| 98 |
|
$message = ( new ViolationMessage( 'wbqc-violation-message-value-needed-of-type' ) ) |
| 99 |
|
->withEntityId( new ItemId( $constraint->getConstraintTypeItemId() ), Role::CONSTRAINT_TYPE_ITEM ) |
| 100 |
|
->withDataValueType( 'wikibase-entityid' ); |
| 101 |
|
return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message ); |
| 102 |
|
} |
| 103 |
|
/** @var EntityIdValue $dataValue */ |
| 104 |
|
|
| 105 |
|
$targetEntityId = $dataValue->getEntityId(); |
src/ConstraintCheck/Checker/TargetRequiredClaimChecker.php 1 location
|
@@ 111-116 (lines=6) @@
|
| 108 |
|
* error handling: |
| 109 |
|
* type of $dataValue for properties with 'Target required claim' constraint has to be 'wikibase-entityid' |
| 110 |
|
*/ |
| 111 |
|
if ( $dataValue->getType() !== 'wikibase-entityid' ) { |
| 112 |
|
$message = ( new ViolationMessage( 'wbqc-violation-message-value-needed-of-type' ) ) |
| 113 |
|
->withEntityId( new ItemId( $constraint->getConstraintTypeItemId() ), Role::CONSTRAINT_TYPE_ITEM ) |
| 114 |
|
->withDataValueType( 'wikibase-entityid' ); |
| 115 |
|
return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message ); |
| 116 |
|
} |
| 117 |
|
/** @var EntityIdValue $dataValue */ |
| 118 |
|
|
| 119 |
|
$targetEntityId = $dataValue->getEntityId(); |
src/ConstraintCheck/Checker/ValueTypeChecker.php 1 location
|
@@ 133-138 (lines=6) @@
|
| 130 |
|
* error handling: |
| 131 |
|
* type of $dataValue for properties with 'Value type' constraint has to be 'wikibase-entityid' |
| 132 |
|
*/ |
| 133 |
|
if ( $dataValue->getType() !== 'wikibase-entityid' ) { |
| 134 |
|
$message = ( new ViolationMessage( 'wbqc-violation-message-value-needed-of-type' ) ) |
| 135 |
|
->withEntityId( new ItemId( $constraint->getConstraintTypeItemId() ), Role::CONSTRAINT_TYPE_ITEM ) |
| 136 |
|
->withDataValueType( 'wikibase-entityid' ); |
| 137 |
|
return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message ); |
| 138 |
|
} |
| 139 |
|
/** @var EntityIdValue $dataValue */ |
| 140 |
|
|
| 141 |
|
try { |
src/ConstraintCheck/Checker/CommonsLinkChecker.php 1 location
|
@@ 127-132 (lines=6) @@
|
| 124 |
|
* type of $dataValue for properties with 'Commons link' constraint has to be 'string' |
| 125 |
|
* parameter $namespace can be null, works for commons galleries |
| 126 |
|
*/ |
| 127 |
|
if ( $dataValue->getType() !== 'string' ) { |
| 128 |
|
$message = ( new ViolationMessage( 'wbqc-violation-message-value-needed-of-type' ) ) |
| 129 |
|
->withEntityId( new ItemId( $constraint->getConstraintTypeItemId() ), Role::CONSTRAINT_TYPE_ITEM ) |
| 130 |
|
->withDataValueType( 'string' ); |
| 131 |
|
return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message ); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
$commonsLink = $dataValue->getValue(); |
| 135 |
|
|