File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 3
3
/composer.lock
4
4
/phpunit.xml
5
5
/.phpunit.result.cache
6
+
7
+ /var
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class TranslationsDumper
34
34
{
35
35
private array $ excludedDomains = [];
36
36
private array $ includedDomains = [];
37
+ private array $ alreadyGeneratedConstants = [];
37
38
38
39
public function __construct (
39
40
private string $ dumpDir ,
@@ -184,16 +185,14 @@ private function getLocaleFallbacks(MessageCatalogueInterface ...$catalogues): a
184
185
185
186
private function generateConstantName (string $ translationId ): string
186
187
{
187
- static $ alreadyGenerated = [];
188
-
189
188
$ translationId = s ($ translationId )->ascii ()->snake ()->upper ()->replaceMatches ('/^(\d)/ ' , '_$1 ' )->toString ();
190
189
$ prefix = 0 ;
191
190
do {
192
191
$ constantName = $ translationId .($ prefix > 0 ? '_ ' .$ prefix : '' );
193
192
++$ prefix ;
194
- } while ($ alreadyGenerated [$ constantName ] ?? false );
193
+ } while ($ this -> alreadyGeneratedConstants [$ constantName ] ?? false );
195
194
196
- $ alreadyGenerated [$ constantName ] = true ;
195
+ $ this -> alreadyGeneratedConstants [$ constantName ] = true ;
197
196
198
197
return $ constantName ;
199
198
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public static function setUpBeforeClass(): void
28
28
29
29
public static function tearDownAfterClass (): void
30
30
{
31
- @unlink (self ::$ cacheDir );
31
+ @rmdir (self ::$ cacheDir );
32
32
}
33
33
34
34
public function test ()
You can’t perform that action at this time.
0 commit comments