Skip to content

Commit bdd9ffb

Browse files
author
André L F S Bacci
committed
Footer support.
1 parent 9dbbcee commit bdd9ffb

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

scripts/translation/lib/OutputIgnoreArgv.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ public static function cacheFile()
8282

8383
function pushAddIgnore( OutputIgnoreBuffer $output, string $mark )
8484
{
85-
$output->add( " php {$this->command} --add-ignore=$mark\n" );
85+
$output->addFooter( " php {$this->command} --add-ignore=$mark\n" );
8686
}
8787

8888
function pushDelIgnore( OutputIgnoreBuffer $output, string $mark )
8989
{
90-
$output->add( " php {$this->command} --del-ignore=$mark\n" );
90+
$output->addFooter( " php {$this->command} --del-ignore=$mark\n" );
9191
}
9292
}

scripts/translation/lib/OutputIgnoreBuffer.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ class OutputIgnoreBuffer
2323
{
2424
public int $printCount = 0;
2525

26-
private string $header = "";
2726
private string $filename = "";
28-
private array $texts = array();
27+
private string $header = "";
28+
private array $texts = array();
29+
private array $footer = array();
2930

3031
private OutputIgnoreArgv $args;
3132

@@ -60,6 +61,11 @@ function addDiff( string $text , int $sourceCount , int $targetCount )
6061
$this->add( "{$prefix}{$text}{$suffix}\n" );
6162
}
6263

64+
function addFooter( string $text )
65+
{
66+
$this->footer[] = $text;
67+
}
68+
6369
function addLine()
6470
{
6571
if ( count( $this->texts ) > 0 && end( $this->texts ) != "\n" )
@@ -112,8 +118,16 @@ function print()
112118
return;
113119

114120
print $this->header;
121+
115122
foreach( $this->texts as $text )
116123
print $text;
124+
125+
if ( count( $this->footer ) )
126+
{
127+
foreach( $this->footer as $text )
128+
print $text;
129+
print "\n";
130+
}
117131
}
118132

119133
private function hash( bool $withContents ) : string

0 commit comments

Comments
 (0)