Skip to content

Commit 553cbcc

Browse files
author
libraryupgrader
committed
build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0 * php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0 Change-Id: Ib31a3e87acd1298e5dad5873e3923f3f69b67fb5
1 parent b9e2d12 commit 553cbcc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
"php": ">=7.2.9"
2323
},
2424
"require-dev": {
25-
"mediawiki/mediawiki-codesniffer": "35.0.0",
25+
"mediawiki/mediawiki-codesniffer": "36.0.0",
2626
"mediawiki/minus-x": "1.1.1",
2727
"ockcyp/covers-validator": "1.3.3",
2828
"php-parallel-lint/php-console-highlighter": "0.5.0",
29-
"php-parallel-lint/php-parallel-lint": "1.2.0",
29+
"php-parallel-lint/php-parallel-lint": "1.3.0",
3030
"phpunit/phpunit": "^8.5"
3131
},
3232
"scripts": {

src/TextCat.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ public function createLM( $text, $maxNgrams ) {
216216
}
217217
if ( $this->minFreq ) {
218218
$min = $this->minFreq;
219-
$ngram = array_filter( $ngram, function ( $v ) use ( $min ) {
219+
$ngram = array_filter( $ngram, static function ( $v ) use ( $min ) {
220220
return $v > $min;
221221
} );
222222
}
223-
uksort( $ngram, function ( $k1, $k2 ) use ( $ngram ) {
223+
uksort( $ngram, static function ( $k1, $k2 ) use ( $ngram ) {
224224
if ( $ngram[$k1] == $ngram[$k2] ) {
225225
return strcmp( $k1, $k2 );
226226
}
@@ -254,7 +254,7 @@ public function writeLanguageFile( $ngrams, $outfile ) {
254254
fwrite( $out, '<?php $ngrams = ' . var_export( $ngrams, true ) . ";\n" );
255255
// write reduced array as "$ranks"
256256
$rank = 1;
257-
$ranks = array_map( function ( $x ) use ( &$rank ) {
257+
$ranks = array_map( static function ( $x ) use ( &$rank ) {
258258
return $rank++;
259259
}, $ngrams );
260260
fwrite( $out, '$ranks = ' . var_export( $ranks, true ) . ";\n" );
@@ -307,7 +307,7 @@ public function classify( $text, $candidates = null ) {
307307

308308
// ignore any item that scores higher than best * resultsRatio
309309
$max = reset( $results ) * $this->resultsRatio;
310-
$results = array_filter( $results, function ( $res ) use ( $max ) {
310+
$results = array_filter( $results, static function ( $res ) use ( $max ) {
311311
return $res <= $max;
312312
} );
313313

@@ -319,7 +319,7 @@ public function classify( $text, $candidates = null ) {
319319

320320
// filter max proportion of max score after ambiguity check; reuse $max variable
321321
$max = count( $inputgrams ) * $this->maxNgrams * $this->maxProportion;
322-
$results = array_filter( $results, function ( $res ) use ( $max ) {
322+
$results = array_filter( $results, static function ( $res ) use ( $max ) {
323323
return $res <= $max;
324324
} );
325325

0 commit comments

Comments
 (0)