Problem:
DM: Add type hints to Statement added the return type ?string to Statement::getGuid(), which breaks Phan in WikibaseQualityConstraints (build):
src/ConstraintCheck/Context/MainSnakContext.php:170 PhanTypeMismatchArgumentNullable Argument 3 ($statementGuid) is $this->statement->getGuid() of type ?string but \WikibaseQuality\ConstraintReport\ConstraintCheck\Context\MainSnakContextCursor::__construct() takes string defined at src/ConstraintCheck/Context/MainSnakContextCursor.php:36 (expected type to be non-nullable) src/ConstraintCheck/Context/QualifierContext.php:43 PhanTypeMismatchArgumentNullable Argument 3 ($statementGuid) is $this->statement->getGuid() of type ?string but \WikibaseQuality\ConstraintReport\ConstraintCheck\Context\QualifierContextCursor::__construct() takes string defined at src/ConstraintCheck/Context/QualifierContextCursor.php:42 (expected type to be non-nullable) src/ConstraintCheck/Context/ReferenceContext.php:51 PhanTypeMismatchArgumentNullable Argument 3 ($statementGuid) is $this->statement->getGuid() of type ?string but \WikibaseQuality\ConstraintReport\ConstraintCheck\Context\ReferenceContextCursor::__construct() takes string defined at src/ConstraintCheck/Context/ReferenceContextCursor.php:48 (expected type to be non-nullable) src/ConstraintCheck/Helper/SparqlHelper.php:370 PhanTypeMismatchArgumentNullableInternal Argument 3 ($subject) is $statement->getGuid() of type ?string but \str_replace() takes array|string (expected type to be non-nullable) src/Job/UpdateConstraintsTableJob.php:156 PhanTypeMismatchArgumentNullable Argument 1 ($constraintId) is $constraintId of type ?string but \WikibaseQuality\ConstraintReport\Constraint::__construct() takes string defined at src/Constraint.php:40 (expected type to be non-nullable)
Possible Solutions:
- In order not to revert work done in DataModel in Wikibase.git, we should simply cast to non-nullable string particularly for Phan, both in WikibaseQualityConstraints, and in MediaInfo
Acceptance Criteria:
- CI in WikibaseQualityConstraints is unblocked
- CI in MediaInfo is unblocked