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 33/composer.lock
44/phpunit.xml
55/.phpunit.result.cache
6+
7+ /var
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class TranslationsDumper
3434{
3535 private array $ excludedDomains = [];
3636 private array $ includedDomains = [];
37+ private array $ alreadyGeneratedConstants = [];
3738
3839 public function __construct (
3940 private string $ dumpDir ,
@@ -184,16 +185,14 @@ private function getLocaleFallbacks(MessageCatalogueInterface ...$catalogues): a
184185
185186 private function generateConstantName (string $ translationId ): string
186187 {
187- static $ alreadyGenerated = [];
188-
189188 $ translationId = s ($ translationId )->ascii ()->snake ()->upper ()->replaceMatches ('/^(\d)/ ' , '_$1 ' )->toString ();
190189 $ prefix = 0 ;
191190 do {
192191 $ constantName = $ translationId .($ prefix > 0 ? '_ ' .$ prefix : '' );
193192 ++$ prefix ;
194- } while ($ alreadyGenerated [$ constantName ] ?? false );
193+ } while ($ this -> alreadyGeneratedConstants [$ constantName ] ?? false );
195194
196- $ alreadyGenerated [$ constantName ] = true ;
195+ $ this -> alreadyGeneratedConstants [$ constantName ] = true ;
197196
198197 return $ constantName ;
199198 }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public static function setUpBeforeClass(): void
2828
2929 public static function tearDownAfterClass (): void
3030 {
31- @unlink (self ::$ cacheDir );
31+ @rmdir (self ::$ cacheDir );
3232 }
3333
3434 public function test ()
You can’t perform that action at this time.
0 commit comments