diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c279b05..03f0a85 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,39 +17,32 @@ jobs: strategy: matrix: include: - - mediawiki_version: '1.39' + - mediawiki_version: '1.43' smw_version: dev-master php_version: 8.1 database_type: mysql - database_image: "mariadb:10" + database_image: "mariadb:10.11" coverage: false experimental: false - - mediawiki_version: '1.40' + - mediawiki_version: '1.43' smw_version: dev-master - php_version: 8.1 + php_version: 8.2 database_type: mysql - database_image: "mariadb:11.2" + database_image: "mariadb:11.4" coverage: true experimental: false - - mediawiki_version: '1.41' + - mediawiki_version: '1.44' smw_version: dev-master - php_version: 8.1 + php_version: 8.3 database_type: mysql - database_image: "mariadb:11.2" + database_image: "mariadb:11.4" coverage: false experimental: false - - mediawiki_version: '1.42' + - mediawiki_version: '1.45' smw_version: dev-master - php_version: 8.1 - database_type: mysql - database_image: "mariadb:11.2" - coverage: false - experimental: false - - mediawiki_version: '1.43' - smw_version: dev-master - php_version: 8.1 + php_version: 8.4 database_type: mysql - database_image: "mariadb:11.2" + database_image: "mariadb:11.8" coverage: false experimental: false diff --git a/composer.json b/composer.json index 491a15a..4d0d3a5 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "mediawiki/http-request": "~2.0|~1.1" }, "require-dev": { - "mediawiki/mediawiki-codesniffer": "43.0.0", + "mediawiki/mediawiki-codesniffer": "46.0.0", "mediawiki/minus-x": "1.1.3", "php-parallel-lint/php-console-highlighter": "1.0.0", "php-parallel-lint/php-parallel-lint": "1.4.0" diff --git a/extension.json b/extension.json index 0bc368d..2f7a5fb 100644 --- a/extension.json +++ b/extension.json @@ -9,9 +9,9 @@ "license-name": "GPL-2.0-or-later", "type": "semantic", "requires": { - "MediaWiki": ">= 1.39", + "MediaWiki": ">= 1.43", "extensions": { - "SemanticMediaWiki": ">= 4.2" + "SemanticMediaWiki": ">= 6.0" } }, "MessagesDirs": { diff --git a/src/ByHttpRequest/CannedResultArray.php b/src/ByHttpRequest/CannedResultArray.php index 5a6907d..79c8429 100644 --- a/src/ByHttpRequest/CannedResultArray.php +++ b/src/ByHttpRequest/CannedResultArray.php @@ -57,7 +57,7 @@ public function __construct( DIWikiPage $resultPage, PrintRequest $printRequest, * * @return DIWikiPage */ - public function getResultSubject() { + public function getResultSubject(): DIWikiPage { return $this->mResult; } @@ -66,7 +66,7 @@ public function getResultSubject() { * * @return SMWDataItem[]|false */ - public function getContent() { + public function getContent(): array|false { $this->loadContent(); if ( !$this->mContent ) { @@ -87,7 +87,7 @@ public function getContent() { * * @return PrintRequest */ - public function getPrintRequest() { + public function getPrintRequest(): PrintRequest { return $this->mPrintRequest; } @@ -113,7 +113,7 @@ public function getNextDataItem() { * * @return SMWDataItem|false */ - public function reset() { + public function reset(): mixed { $this->loadContent(); $result = reset( $this->mContent ); diff --git a/src/ByHttpRequest/QueryResult.php b/src/ByHttpRequest/QueryResult.php index 304e791..c4c7cf6 100644 --- a/src/ByHttpRequest/QueryResult.php +++ b/src/ByHttpRequest/QueryResult.php @@ -48,7 +48,7 @@ public function setJsonResponseParser( JsonResponseParser $jsonResponseParser ) * * @return array */ - public function toArray() { + public function toArray(): array { return $this->jsonResponseParser->getRawResponseResult(); } @@ -59,7 +59,7 @@ public function toArray() { * * @return array */ - public function serializeToArray() { + public function serializeToArray(): array { return $this->toArray(); } @@ -68,7 +68,7 @@ public function serializeToArray() { * * @return CannedResultArray[]|false */ - public function getNext() { + public function getNext(): false|array { $page = current( $this->mResults ); next( $this->mResults ); diff --git a/src/ByHttpRequest/ResponsePropertyList.php b/src/ByHttpRequest/ResponsePropertyList.php index 3cfe2d6..da89f3e 100644 --- a/src/ByHttpRequest/ResponsePropertyList.php +++ b/src/ByHttpRequest/ResponsePropertyList.php @@ -118,10 +118,10 @@ private function newProperty( $value ) { $property = DIProperty::newFromUserLabel( $value['label'] ); if ( $property->isUserDefined() ) { - return $property->setPropertyTypeId( $value['typeid'] ); + return $property->setPropertyValueType( $value['typeid'] ); } - if ( $property->findPropertyTypeID() === $value['typeid'] ) { + if ( $property->findPropertyValueType() === $value['typeid'] ) { return $property; } diff --git a/src/DataValueDeserializer.php b/src/DataValueDeserializer.php index f1e9890..8bba5b8 100644 --- a/src/DataValueDeserializer.php +++ b/src/DataValueDeserializer.php @@ -2,6 +2,7 @@ namespace SEQL; +use MediaWiki\Title\Title; use SMW\DataModel\ContainerSemanticData; use SMW\DataValueFactory; use SMW\DIProperty; @@ -97,7 +98,7 @@ public function newDiWikiPage( array $value ) { $value['fulltext'] = substr( $value['fulltext'], ( $pos = strpos( $value['fulltext'], ':' ) ) !== false ? $pos + 1 : 0 ); } - $title = \Title::newFromText( $this->querySource . ':' . str_replace( " ", "_", $value['fulltext'] ), $ns ); + $title = Title::newFromText( $this->querySource . ':' . str_replace( " ", "_", $value['fulltext'] ), $ns ); return DIWikiPage::newFromTitle( $title ); } diff --git a/tests/phpunit/Unit/DataValueDeserializerTest.php b/tests/phpunit/Unit/DataValueDeserializerTest.php index a8a5048..68ced1b 100644 --- a/tests/phpunit/Unit/DataValueDeserializerTest.php +++ b/tests/phpunit/Unit/DataValueDeserializerTest.php @@ -51,7 +51,7 @@ public function testNewTimeValueForOutOfRangeTimestamp() { $instance = new DataValueDeserializer( 'foo' ); $property = new DIProperty( 'Bar' ); - $property->setPropertyTypeId( '_dat' ); + $property->setPropertyValueType( '_dat' ); $this->assertNotEquals( DITime::doUnserialize( '2/-200' ), @@ -63,7 +63,7 @@ public function testNewTimeValueForRawTimeFromat() { $instance = new DataValueDeserializer( 'foo' ); $property = new DIProperty( 'Bar' ); - $property->setPropertyTypeId( '_dat' ); + $property->setPropertyValueType( '_dat' ); $this->assertEquals( DITime::doUnserialize( '2/-200' ), @@ -75,7 +75,7 @@ public function testNewRecordValue() { $instance = new DataValueDeserializer( 'foo' ); $property = new DIProperty( 'Foo' ); - $property->setPropertyTypeId( '_rec' ); + $property->setPropertyValueType( '_rec' ); $item = [ 'namespace' => NS_MAIN, @@ -98,7 +98,7 @@ public function testTextValueWithEmbeddedLink() { $instance = new DataValueDeserializer( 'abc' ); $property = new DIProperty( 'Bar' ); - $property->setPropertyTypeId( '_txt' ); + $property->setPropertyValueType( '_txt' ); $dataValue = $instance->newDataValueFrom( $property, 'Foo [[42]] bar' );