Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated optional being before required params #5941

Merged
merged 9 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Elastic/QueryEngine/ConditionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
*
* @return array
*/
public function findHierarchyMembers( ?DataItem $dataItem = null, $hierarchyDepth ) {
public function findHierarchyMembers( ?DataItem $dataItem, $hierarchyDepth ) {

Check warning on line 373 in src/Elastic/QueryEngine/ConditionBuilder.php

View check run for this annotation

Codecov / codecov/patch

src/Elastic/QueryEngine/ConditionBuilder.php#L373

Added line #L373 was not covered by tests
$ids = [];

if ( $dataItem !== null && ( $members = $this->hierarchyLookup->getConsecutiveHierarchyList( $dataItem ) ) !== [] ) {
Expand Down
2 changes: 1 addition & 1 deletion src/EntityLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getProperties( DIWikiPage $subject, ?RequestOptions $requestOpti
*
* @return DataItem[]|[]|Iterator
*/
public function getPropertyValues( ?DIWikiPage $subject = null, DIProperty $property, ?RequestOptions $requestOptions = null );
public function getPropertyValues( ?DIWikiPage $subject, DIProperty $property, ?RequestOptions $requestOptions = null );

/**
* Get an array of all subjects that have the given value for the given
Expand Down
2 changes: 1 addition & 1 deletion src/Query/DescriptionBuilders/DescriptionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function clearErrors() {
* @param string|null $value
* @param string|int &$comparator
*/
protected function prepareValue( ?DIProperty $property = null, &$value, &$comparator ) {
protected function prepareValue( ?DIProperty $property, &$value, &$comparator ) {
$comparator = QueryComparator::getInstance()->extractComparatorFromString( $value );

// [[in:lorem ipsum]] / [[Has text::in:lorem ipsum]] to be turned into a
Expand Down
2 changes: 1 addition & 1 deletion src/SPARQLStore/QueryEngine/QueryResultFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
*
* @return QueryResult
*/
public function newQueryResult( ?RepositoryResult $repositoryResult = null, Query $query ) {
public function newQueryResult( ?RepositoryResult $repositoryResult, Query $query ) {

Check warning on line 62 in src/SPARQLStore/QueryEngine/QueryResultFactory.php

View check run for this annotation

Codecov / codecov/patch

src/SPARQLStore/QueryEngine/QueryResultFactory.php#L62

Added line #L62 was not covered by tests
if ( $repositoryResult === null ) {
return $this->newEmptyQueryResult( $query );
}
Expand Down
8 changes: 4 additions & 4 deletions src/SQLStore/EntityStore/CachingSemanticDataLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function newRequestOptions( PropertyTableDefinition $propertyTableDef, DI
*
* @return
*/
public function prefetchDataFromTable( array $subjects, ?DataItem $dataItem = null, PropertyTableDefinition $propertyTableDef, ?RequestOptions $requestOptions = null ) {
public function prefetchDataFromTable( array $subjects, ?DataItem $dataItem, PropertyTableDefinition $propertyTableDef, ?RequestOptions $requestOptions = null ) {
$hash = '';

if ( $dataItem !== null ) {
Expand Down Expand Up @@ -251,7 +251,7 @@ public function prefetchDataFromTable( array $subjects, ?DataItem $dataItem = nu
*
* @return RequestOptions|null
*/
public function fetchSemanticDataFromTable( $id, ?DataItem $dataItem = null, PropertyTableDefinition $propertyTableDef, ?RequestOptions $requestOptions = null ) {
public function fetchSemanticDataFromTable( $id, ?DataItem $dataItem, PropertyTableDefinition $propertyTableDef, ?RequestOptions $requestOptions = null ) {
return $this->semanticDataLookup->fetchSemanticDataFromTable( $id, $dataItem, $propertyTableDef, $requestOptions );
}

Expand All @@ -265,7 +265,7 @@ public function fetchSemanticDataFromTable( $id, ?DataItem $dataItem = null, Pro
*
* @return SemanticData
*/
public function getSemanticData( $id, ?DataItem $dataItem = null, PropertyTableDefinition $propertyTableDef, ?RequestOptions $requestOptions = null ) {
public function getSemanticData( $id, ?DataItem $dataItem, PropertyTableDefinition $propertyTableDef, ?RequestOptions $requestOptions = null ) {
// Avoid the cache when a request is constrainted
if ( $requestOptions !== null || !$dataItem instanceof DIWikiPage ) {
return $this->semanticDataLookup->getSemanticData( $id, $dataItem, $propertyTableDef, $requestOptions );
Expand All @@ -285,7 +285,7 @@ public function newStubSemanticData( DIWikiPage $subject ) {
return $this->semanticDataLookup->newStubSemanticData( $subject );
}

private function fetchFromCache( $id, ?DataItem $dataItem = null, PropertyTableDefinition $propertyTableDef ) {
private function fetchFromCache( $id, ?DataItem $dataItem, PropertyTableDefinition $propertyTableDef ) {
// Do not clear the cache when called recursively.
$this->lockCache();
$this->initLookupCache( $id, $dataItem );
Expand Down
2 changes: 1 addition & 1 deletion src/SQLStore/EntityStore/EntityLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function getProperties( DIWikiPage $subject, ?RequestOptions $requestOpti
*
* {@inheritDoc}
*/
public function getPropertyValues( ?DIWikiPage $subject = null, DIProperty $property, ?RequestOptions $requestOptions = null ) {
public function getPropertyValues( ?DIWikiPage $subject, DIProperty $property, ?RequestOptions $requestOptions = null ) {
$idTable = $this->store->getObjectIds();

if ( $property->isInverse() ) { // inverses are working differently
Expand Down
4 changes: 2 additions & 2 deletions src/SQLStore/EntityStore/SemanticDataLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function getTableUsageInfo( SemanticData $semanticData ) {
*
* @return SemanticData
*/
public function getSemanticData( $id, ?DataItem $dataItem = null, PropertyTableDefinition $propTable, ?RequestOptions $requestOptions = null ) {
public function getSemanticData( $id, ?DataItem $dataItem, PropertyTableDefinition $propTable, ?RequestOptions $requestOptions = null ) {
if ( !$dataItem instanceof DIWikiPage ) {
throw new RuntimeException( 'Expected a DIWikiPage instance' );
}
Expand Down Expand Up @@ -313,7 +313,7 @@ public function prefetchDataFromTable( array $subjects, DIProperty $property, Pr
*
* @return array
*/
public function fetchSemanticDataFromTable( $id, ?DataItem $dataItem = null, PropertyTableDefinition $propTable, ?RequestOptions $requestOptions = null ) {
public function fetchSemanticDataFromTable( $id, ?DataItem $dataItem, PropertyTableDefinition $propTable, ?RequestOptions $requestOptions = null ) {
paladox marked this conversation as resolved.
Show resolved Hide resolved
$isSubject = $dataItem instanceof DIWikiPage || $dataItem === null;

// stop if there is not enough data:
Expand Down
Loading