Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 0 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
fail-fast: false
matrix:
include:
- mediawiki: REL1_39
smw: 4.2.0
- mediawiki: REL1_43
smw: 6.0.1
steps:
Expand Down Expand Up @@ -122,13 +120,6 @@ jobs:
jq '.AutoloadNamespaces."SMW\\Maintenance\\" = "maintenance/" | delpaths([["AutoloadNamespaces", "SMW\\Maintenance"]])' \
extension.json > extension.json.tmp && mv extension.json.tmp extension.json

# Make sure we don't get errors about return types
- name: SMW - fix iterator return types
if: ${{ matrix.smw == '4.2.0' }}
working-directory: ${{ github.workspace }}/SemanticMediaWiki
run: |
sed --regexp-extended 's/public function (current|key|next|rewind|valid|count)/#[\\ReturnTypeWillChange] public function \1/' -i src/Iterators/CsvFileIterator.php

- name: Mediawiki PHPUnit
uses: wikiteq/mediawiki-phpunit-action@master
with:
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"descriptionmsg": "semanticreports-desc",
"license-name": "MIT",
"requires": {
"MediaWiki": ">= 1.39.0",
"MediaWiki": ">= 1.43.0",
"extensions": {
"SemanticMediaWiki": ">= 4.2.0"
}
Expand Down
4 changes: 2 additions & 2 deletions includes/SemanticReports.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// We run Phan with both MW 1.39 and MW 1.43, the suppression from 1.39 isn't
// needed on 1.43 and phan would complain about that
// The file-level suppression below is still needed on MW 1.43; without it
// Phan complains about the unused suppression
// @phan-file-suppress UnusedPluginSuppression,UnusedPluginFileSuppression

namespace MediaWiki\Extension\SemanticReports;
Expand Down
18 changes: 2 additions & 16 deletions maintenance/GenerateReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace MediaWiki\Extension\SemanticReports\Maintenance;

use MediaWiki\Extension\SemanticReports\SemanticReports;
use MediaWiki\MediaWikiServices;
use RuntimeException;

$IP = getenv( 'MW_INSTALL_PATH' );
Expand All @@ -12,9 +11,6 @@
}
require_once "$IP/maintenance/Maintenance.php";

/**
* @method \MediaWiki\MediaWikiServices getServiceContainer() available in 1.40+
*/
class GenerateReport extends \Maintenance {

/**
Expand All @@ -39,14 +35,8 @@ public function __construct() {
* @return null
*/
public function execute() {
// REL1_39 compat
if ( !method_exists( $this, 'getServiceContainer' ) ) {
/** @var SemanticReports $semanticReports */
$semanticReports = MediaWikiServices::getInstance()->get( 'SemanticReports' );
} else {
/** @var SemanticReports $semanticReports */
$semanticReports = $this->getServiceContainer()->get( 'SemanticReports' );
}
/** @var SemanticReports $semanticReports */
$semanticReports = $this->getServiceContainer()->get( 'SemanticReports' );
$query = $this->getOption( 'query' );
$format = $this->getOption( 'format' );

Expand Down Expand Up @@ -102,10 +92,6 @@ public function execute() {
* @return never
*/
protected function fatalError( $msg, $exitCode = 1 ) {
// Until 1.43 fatalError() would call exit() unconditionally, making it
// impossible to test fatalError() calls, see T272241
// In tests always use RuntimeException so that we support both 1.39 and
// 1.43
if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
parent::fatalError( $msg, $exitCode );
} else {
Expand Down
Loading