Skip to content

Commit bcb2ff6

Browse files
committed
minor #15832 [Translation][File dumper] allow new child classes to implement only formatCatalogue (aitboudad)
This PR was merged into the 2.8 branch. Discussion ---------- [Translation][File dumper] allow new child classes to implement only formatCatalogue | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Fixed tickets | #15699 | Tests pass? | yes | License | MIT Commits ------- 5fd9f2f [Translation][File dumper] allow new child classes to implement only formatCatalogue.
2 parents 2e5e601 + 5fd9f2f commit bcb2ff6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Symfony/Component/Translation/Dumper/FileDumper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ protected function formatCatalogue(MessageCatalogue $messages, $domain, array $o
114114
*
115115
* @deprecated since version 2.8, to be removed in 3.0. Overwrite formatCatalogue() instead.
116116
*/
117-
abstract protected function format(MessageCatalogue $messages, $domain);
117+
protected function format(MessageCatalogue $messages, $domain)
118+
{
119+
throw new \LogicException('The "FileDumper::format" method needs to be overwritten, you should implement either "format" or "formatCatalogue".');
120+
}
118121

119122
/**
120123
* Gets the file extension of the dumper.

src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ protected function formatCatalogue(MessageCatalogue $messages, $domain, array $o
6363
return '';
6464
}
6565

66-
protected function format(MessageCatalogue $messages, $domain)
67-
{
68-
return $this->formatCatalogue($messages, $domain);
69-
}
70-
7166
protected function getExtension()
7267
{
7368
return 'concrete';

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy