Skip to content

Commit

Permalink
Add missing use statement and deprecate old methods (#908)
Browse files Browse the repository at this point in the history
* Add missing use statement and deprecate old methods

* Update SRF_Boilerplate.php
  • Loading branch information
alistair3149 authored Feb 26, 2025
1 parent d316ba9 commit 96062b3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions formats/boilerplate/SRF_Boilerplate.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use SMW\Query\QueryResult;
use SMW\Query\Result\ResultArray;
use SMW\Query\ResultPrinters\ResultPrinter;

/**
Expand Down Expand Up @@ -101,12 +102,12 @@ protected function getResultData( QueryResult $result, $outputMode ) {
/**
* Get all values for all rows that belong to the result set
*
* @var \SMW\Query\Result\ResultArray $rows
* @var ResultArray $rows
*/
while ( $rows = $result->getNext() ) {

/**
* @var \SMW\Query\Result\ResultArray $field
* @var ResultArray $field
* @var SMWDataValue $dataValue
*/
foreach ( $rows as $field ) {
Expand Down
5 changes: 3 additions & 2 deletions formats/datatables/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
namespace SRF\DataTables;

use ApiBase;
use ParamProcessor\ParamDefinition;
use ParamProcessor\ParamDefinitionFactory;
use SMW\DataValueFactory;
use SMW\DataValues\PropertyChainValue;
use SMW\Query\PrintRequest;
use SMW\Services\ServicesFactory;
use SMWQuery;
use SMWQueryProcessor;
use SpecialVersion;
use SRF\DataTables;

class Api extends ApiBase {
Expand Down Expand Up @@ -53,7 +54,7 @@ public function execute() {
$printer = new Datatables( 'datatables', true );

// get defaults of parameters for the 'datatable' result format as array of ParamDefinition
$paramDefinitions = ParamDefinition::getCleanDefinitions( $printer->getParamDefinitions( [] ) );
$paramDefinitions = ParamDefinitionFactory::newDefault()->newDefinitionsFromArrays( $printer->getParamDefinitions( [] ) );

// transform into normal key-value array
$parameters = [];
Expand Down
2 changes: 2 additions & 0 deletions formats/datatables/DataTables.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
use SMW\DataValues\PropertyValue;
use SMW\DIWikiPage;
use SMW\Localizer\Message;
use SMW\Parser\RecursiveTextProcessor;
use SMW\Query\PrintRequest;
use SMW\Query\QueryResult;
use SMW\Query\ResultPrinters\ResultPrinter;
use SMW\Utils\HtmlTable;
use SMWDIBlob as DIBlob;
use SRF\DataTables\SearchPanes;

class DataTables extends ResultPrinter {
Expand Down
4 changes: 2 additions & 2 deletions formats/datatables/SearchPanes.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private function getPanesOptions( $printRequest, $canonicalLabel, $searchPanesOp
$qobj = $querySegmentList[$rootid];

$property = new DIProperty( DIProperty::newFromUserLabel( $printRequest->getCanonicalLabel() ) );
$propTypeid = $property->findPropertyTypeID();
$propTypeid = $property->findPropertyValueType();

if ( $isCategory ) {

Expand Down Expand Up @@ -305,7 +305,7 @@ private function getPanesOptions( $printRequest, $canonicalLabel, $searchPanesOp
}

// @see ByGroupPropertyValuesLookup
$diType = DataTypeRegistry::getInstance()->getDataItemId(
$diType = DataTypeRegistry::getInstance()->getDataItemByType(
$propTypeid
);

Expand Down
1 change: 0 additions & 1 deletion src/Graph/GraphPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use MediaWiki\MediaWikiServices;
use SMW\Query\PrintRequest;
use SMW\Query\QueryResult;
use SMW\Query\Result\ResultArray;
use SMW\Query\ResultPrinters\ResultPrinter;

/**
Expand Down

0 comments on commit 96062b3

Please sign in to comment.