From 96062b3b6cf8ff82f469697b89abc26d72ddcf22 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 26 Feb 2025 05:40:45 -0500 Subject: [PATCH] Add missing use statement and deprecate old methods (#908) * Add missing use statement and deprecate old methods * Update SRF_Boilerplate.php --- formats/boilerplate/SRF_Boilerplate.php | 5 +++-- formats/datatables/Api.php | 5 +++-- formats/datatables/DataTables.php | 2 ++ formats/datatables/SearchPanes.php | 4 ++-- src/Graph/GraphPrinter.php | 1 - 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/formats/boilerplate/SRF_Boilerplate.php b/formats/boilerplate/SRF_Boilerplate.php index 642e61db..5862604a 100644 --- a/formats/boilerplate/SRF_Boilerplate.php +++ b/formats/boilerplate/SRF_Boilerplate.php @@ -1,6 +1,7 @@ getNext() ) { /** - * @var \SMW\Query\Result\ResultArray $field + * @var ResultArray $field * @var SMWDataValue $dataValue */ foreach ( $rows as $field ) { diff --git a/formats/datatables/Api.php b/formats/datatables/Api.php index d8dff952..9ee1bb86 100644 --- a/formats/datatables/Api.php +++ b/formats/datatables/Api.php @@ -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 { @@ -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 = []; diff --git a/formats/datatables/DataTables.php b/formats/datatables/DataTables.php index febe45aa..f36162e8 100644 --- a/formats/datatables/DataTables.php +++ b/formats/datatables/DataTables.php @@ -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 { diff --git a/formats/datatables/SearchPanes.php b/formats/datatables/SearchPanes.php index d53dcc64..76f1acc1 100644 --- a/formats/datatables/SearchPanes.php +++ b/formats/datatables/SearchPanes.php @@ -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 ) { @@ -305,7 +305,7 @@ private function getPanesOptions( $printRequest, $canonicalLabel, $searchPanesOp } // @see ByGroupPropertyValuesLookup - $diType = DataTypeRegistry::getInstance()->getDataItemId( + $diType = DataTypeRegistry::getInstance()->getDataItemByType( $propTypeid ); diff --git a/src/Graph/GraphPrinter.php b/src/Graph/GraphPrinter.php index d0f73d87..ee1a4343 100644 --- a/src/Graph/GraphPrinter.php +++ b/src/Graph/GraphPrinter.php @@ -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; /**