Skip to content

Commit a355899

Browse files
committed
Rename $files to $filterFiles and warn on missing source files
Address review feedback: rename parameter for clarity and add STDERR warning when a command-line file is not found in sourceDir.
1 parent 00d86bc commit a355899

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/translation/libqa/SyncFileList.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class SyncFileList
2323
{
24-
static function load( ?string $lang = null , array $files = [] )
24+
static function load( ?string $lang = null , array $filterFiles = [] )
2525
{
2626
if ( $lang === null )
2727
{
@@ -37,12 +37,17 @@ static function load( ?string $lang = null , array $files = [] )
3737
$sourceDir = 'en';
3838
$targetDir = $lang;
3939

40-
if ( count( $files ) > 0 )
40+
if ( count( $filterFiles ) > 0 )
4141
{
4242
$ret = [];
4343

44-
foreach ( $files as $file )
44+
foreach ( $filterFiles as $file )
4545
{
46+
if ( ! file_exists( "$sourceDir/$file" ) )
47+
{
48+
fwrite( STDERR , "File not found in source: $sourceDir/$file\n" );
49+
continue;
50+
}
4651
if ( ! file_exists( "$targetDir/$file" ) )
4752
continue;
4853

0 commit comments

Comments
 (0)