From 74bdf0a7ddd538a4cdc9a999ff4938d5af276449 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Tue, 12 Mar 2024 20:22:40 +0100 Subject: [PATCH] build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0 Change-Id: I7a3887f4fac7c4e78e0828fca52d0c355357e5b1 --- composer.json | 7 ++++++- includes/ApiQueryExtracts.php | 2 +- includes/TextTruncator.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 605b0a5..735a230 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "mediawiki/mediawiki-codesniffer": "41.0.0", + "mediawiki/mediawiki-codesniffer": "43.0.0", "mediawiki/mediawiki-phan-config": "0.14.0", "mediawiki/minus-x": "1.1.1", "php-parallel-lint/php-console-highlighter": "1.0.0", @@ -18,5 +18,10 @@ ], "phan": "phan -d . --long-progress-bar", "phpcs": "phpcs -sp --cache" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/includes/ApiQueryExtracts.php b/includes/ApiQueryExtracts.php index 9c38411..c6b86b7 100644 --- a/includes/ApiQueryExtracts.php +++ b/includes/ApiQueryExtracts.php @@ -315,7 +315,7 @@ class ApiQueryExtracts extends ApiQueryBase { 'url' => $this->getRequest()->getFullRequestURL(), 'exception' => $apiException, 'request' => $request - ] ); + ] ); return null; } diff --git a/includes/TextTruncator.php b/includes/TextTruncator.php index f09999b..ecb88b1 100644 --- a/includes/TextTruncator.php +++ b/includes/TextTruncator.php @@ -61,7 +61,7 @@ class TextTruncator { } $index = min( $requestedSentenceCount, $res ) - 1; - list( $tail, $length ) = $matches[0][$index]; + [ $tail, $length ] = $matches[0][$index]; // PCRE returns raw offsets, so using substr() instead of mb_substr() $text = substr( $text, 0, $length ) . $tail;