build: Updating dependencies

composer:
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

npm:
* grunt: 1.3.0 → 1.4.0
* lodash: 4.17.19 → 4.17.21
  * https://npmjs.com/advisories/1673 (CVE-2021-23337)

Change-Id: I6797ecfc38973777657d1d4611363595b23e4afd
This commit is contained in:
libraryupgrader 2021-05-12 09:23:38 +00:00 committed by Umherirrender
parent c6fd5dd8a4
commit 668d044574
9 changed files with 135 additions and 1082 deletions

View file

@ -1,10 +1,10 @@
{
"require-dev": {
"mediawiki/mediawiki-codesniffer": "35.0.0",
"mediawiki/mediawiki-codesniffer": "36.0.0",
"mediawiki/mediawiki-phan-config": "0.10.6",
"mediawiki/minus-x": "1.1.1",
"php-parallel-lint/php-console-highlighter": "0.5.0",
"php-parallel-lint/php-parallel-lint": "1.2.0"
"php-parallel-lint/php-parallel-lint": "1.3.0"
},
"scripts": {
"fix": [

View file

@ -75,7 +75,7 @@ class LinksUpdateHookHandler {
}
if ( $po && $po->getExtensionData( 'pageImages' ) ) {
return array_map( function ( $candidateData ) {
return array_map( static function ( $candidateData ) {
return PageImageCandidate::newFromArray( $candidateData );
}, $po->getExtensionData( 'pageImages' ) );
}

View file

@ -40,13 +40,13 @@ class SearchResultProvideThumbnailHookHandler {
$pagesByPageId,
PageImages::getPropNames( PageImages::LICENSE_ANY )
);
$fileNames = array_map( function ( $prop ) {
$fileNames = array_map( static function ( $prop ) {
return $prop[ PageImages::getPropName( false ) ]
?? $prop[ PageImages::getPropName( true ) ]
?? null;
}, $propValues );
return array_filter( $fileNames, function ( $fileName ) {
return array_filter( $fileNames, static function ( $fileName ) {
return $fileName != null;
} );
}
@ -59,7 +59,7 @@ class SearchResultProvideThumbnailHookHandler {
* @return array
*/
private function getFileNamesForFileTitles( $linkFileTargetsByPageId ): array {
return array_map( function ( $linkFileTarget ) {
return array_map( static function ( $linkFileTarget ) {
return $linkFileTarget->getDBkey();
}, $linkFileTargetsByPageId );
}
@ -72,10 +72,10 @@ class SearchResultProvideThumbnailHookHandler {
* @return SearchResultThumbnail[]
*/
private function getThumbnails( array $titlesByPageId, int $size ): array {
$pagesByPageId = array_filter( $titlesByPageId, function ( $title ) {
$pagesByPageId = array_filter( $titlesByPageId, static function ( $title ) {
return !$title->inNamespace( NS_FILE );
} );
$titleFilesByPageId = array_filter( $titlesByPageId, function ( $title ) {
$titleFilesByPageId = array_filter( $titlesByPageId, static function ( $title ) {
return $title->inNamespace( NS_FILE );
} );
@ -115,7 +115,7 @@ class SearchResultProvideThumbnailHookHandler {
* @param array &$results Placeholder for result. $pageId => SearchResultThumbnail
*/
public function doSearchResultProvideThumbnail( array $pageIdentities, &$results ): void {
$pageIdTitles = array_map( function ( SearchResultPageIdentity $identity ) {
$pageIdTitles = array_map( static function ( SearchResultPageIdentity $identity ) {
return Title::makeTitle( $identity->getNamespace(), $identity->getDBkey() );
}, $pageIdentities );

1175
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@
},
"devDependencies": {
"eslint-config-wikimedia": "0.20.0",
"grunt": "1.3.0",
"grunt": "1.4.0",
"grunt-banana-checker": "0.9.0",
"grunt-eslint": "23.0.0"
}

View file

@ -138,7 +138,7 @@ class ApiQueryPageImagesTest extends TestCase {
$mock = TestingAccessWrapper::newFromObject(
$this->getMockBuilder( ApiQueryPageImages::class )
->disableOriginalConstructor()
->setMethods( [ 'extractRequestParams', 'getTitles', 'setContinueParameter', 'dieUsage',
->onlyMethods( [ 'extractRequestParams', 'getTitles', 'dieWithError',
'addTables', 'addFields', 'addWhere', 'select', 'setResultValues' ] )
->getMock()
);
@ -154,7 +154,7 @@ class ApiQueryPageImagesTest extends TestCase {
&& $requestParams['continue'] > count( $titles )
) {
$mock->expects( $this->once() )
->method( 'dieUsage' );
->method( 'dieWithError' );
}
$originalRequested = in_array( 'original', $requestParams['prop'] );

View file

@ -115,7 +115,7 @@ class LinksUpdateHookHandlerTest extends MediaWikiTestCase {
$linksUpdate = $this->getLinksUpdate( $images );
$mock = TestingAccessWrapper::newFromObject(
$this->getMockBuilder( LinksUpdateHookHandler::class )
->setMethods( [ 'getScore', 'isImageFree' ] )
->onlyMethods( [ 'getScore', 'isImageFree' ] )
->getMock()
);
@ -126,7 +126,7 @@ class LinksUpdateHookHandlerTest extends MediaWikiTestCase {
$mock->method( 'getScore' )
->willReturnCallback(
function ( PageImageCandidate $_, $position ) use ( $images ) {
static function ( PageImageCandidate $_, $position ) use ( $images ) {
return $images[$position]['score'];
}
);
@ -218,7 +218,7 @@ class LinksUpdateHookHandlerTest extends MediaWikiTestCase {
public function testGetScore( $image, $scoreFromTable, $position, $expected ) {
$mock = TestingAccessWrapper::newFromObject(
$this->getMockBuilder( LinksUpdateHookHandler::class )
->setMethods( [ 'scoreFromTable', 'getMetadata', 'getRatio', 'getDenylist' ] )
->onlyMethods( [ 'scoreFromTable', 'fetchFileMetadata', 'getRatio', 'getDenylist' ] )
->getMock()
);
$mock->method( 'scoreFromTable' )
@ -342,7 +342,7 @@ class LinksUpdateHookHandlerTest extends MediaWikiTestCase {
$mock = TestingAccessWrapper::newFromObject(
$this->getMockBuilder( LinksUpdateHookHandler::class )
->setMethods( [ 'fetchFileMetadata' ] )
->onlyMethods( [ 'fetchFileMetadata' ] )
->getMock()
);
$mock->method( 'fetchFileMetadata' )

View file

@ -32,7 +32,7 @@ class SearchResultProvideThumbnailHookHandlerTest extends MediaWikiTestCase {
): ThumbnailImage {
$thumbnail = $this->getMockBuilder( ThumbnailImage::class )
->disableOriginalConstructor()
->setMethods( [
->onlyMethods( [
'getLocalCopyPath',
'getWidth',
'getHeight',
@ -73,7 +73,7 @@ class SearchResultProvideThumbnailHookHandlerTest extends MediaWikiTestCase {
private function getMockLocalFile( int $size, $thumbFilePath ): LocalFile {
$file = $this->getMockBuilder( LocalFile::class )
->disableOriginalConstructor()
->setMethods( [
->onlyMethods( [
'transform',
'getMimeType'
] )
@ -94,7 +94,7 @@ class SearchResultProvideThumbnailHookHandlerTest extends MediaWikiTestCase {
public function testProvideThumbnail() {
$pageProps = $this->getMockBuilder( PageProps::class )
->disableOriginalConstructor()
->setMethods( [ 'getProperties' ] )
->onlyMethods( [ 'getProperties' ] )
->getMock();
$pageIdentities = [
@ -120,7 +120,7 @@ class SearchResultProvideThumbnailHookHandlerTest extends MediaWikiTestCase {
$repoGroup = $this->getMockBuilder( RepoGroup::class )
->disableOriginalConstructor()
->setMethods( [ 'findFile' ] )
->onlyMethods( [ 'findFile' ] )
->getMock();
$repoGroup->expects( $this->exactly( 4 ) )

View file

@ -63,7 +63,7 @@ class PageImagesTest extends MediaWikiTestCase {
->willReturn( $config );
$outputPage = $this->getMockBuilder( OutputPage::class )
->setMethods( [ 'addMeta' ] )
->onlyMethods( [ 'addMeta' ] )
->setConstructorArgs( [ $context ] )
->getMock();
$outputPage->expects( $this->never() )