Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Translation][Writer] avoid calling setBackup if the dumper is not FileDumper #16912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2016

Conversation

aitboudad
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets ~
License MIT
Doc PR n/a

@@ -45,7 +46,9 @@ public function addDumper($format, DumperInterface $dumper)
public function disableBackup()
{
foreach ($this->dumpers as $dumper) {
$dumper->setBackup(false);
if ($dumper instanceof FileDumper) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using method_exists() here instead to support users who create their own dumpers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@aitboudad aitboudad force-pushed the translation_writer_backup branch from b4f2a7c to 6c700c1 Compare December 10, 2015 20:12
@xabbuh
Copy link
Member

xabbuh commented Dec 10, 2015

👍

Status: Reviewed

@@ -13,6 +13,7 @@

use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Dumper\DumperInterface;
use Symfony\Component\Translation\Dumper\FileDumper;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should now be removed again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed thanks!

@aitboudad aitboudad force-pushed the translation_writer_backup branch from 6c700c1 to 6c43dc0 Compare December 10, 2015 20:20

$writer = new TranslationWriter();
$writer->addDumper('test', $dumper);
$writer->writeTranslations(new MessageCatalogue([]), 'test');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed that but tests are failing: We cannot use the short array syntax here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should work now, I'll pay more attention next time ;)

@xabbuh
Copy link
Member

xabbuh commented Dec 10, 2015

Status: Needs work

@nicolas-grekas
Copy link
Member

Would it make sense to create an interface for setBackup on 3.1? method_exists is quite fragile imho

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

Thank you @aitboudad.

@fabpot fabpot merged commit 369b2d4 into symfony:2.7 Jan 25, 2016
fabpot added a commit that referenced this pull request Jan 25, 2016
…r is not FileDumper (aitboudad)

This PR was merged into the 2.7 branch.

Discussion
----------

[Translation][Writer] avoid calling setBackup if the dumper is not FileDumper

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |  ~
| License       | MIT
| Doc PR        | n/a

Commits
-------

369b2d4 [Translation][Writer] avoid calling setBackup if the dumper is not an instance of FileDumper.
@fabpot fabpot mentioned this pull request Feb 3, 2016
This was referenced Feb 28, 2016
fabpot added a commit that referenced this pull request Apr 1, 2016
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Translation] deprecate the backup feature

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #16912 (comment)
| License       | MIT
| Doc PR        |

Commits
-------

6c3ddf1 [Translation] deprecate the backup feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.