[Translation] added option json_options to JsonFileDumper.#14750
Conversation
There was a problem hiding this comment.
Wrong docblock. This method isn't inherited from anything.
There was a problem hiding this comment.
@ogizanagi
this code inherit my previous, accepted PR:
https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Translation/Dumper/FileDumper.php
There was a problem hiding this comment.
There was a problem hiding this comment.
Oh, sorry. Now I understand. Please forget about my next comment.
|
can we found another name rather than |
|
@aitboudad I will think about better name, just 'options' are even worse. Other alternative is to add several options - one per JSON_* constants and hide from user, that this class use json_encode internally. But it would be hard to maintain such code. |
|
|
|
I prefer "json_encoding" for consistency. see https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php#L173 |
There was a problem hiding this comment.
I prefer $flags instead of $jsonOptions
|
@dosten 👍 |
|
@dosten 👍 apply |
There was a problem hiding this comment.
This is wrong, the variable name must be $flags but the option name must be "json_encoding"
8a92e11 to
fb11aac
Compare
|
@dosten done |
|
You should fix the two failing tests |
|
sorry, missed your message. Done |
|
👍 |
|
ping @symfony/deciders |
There was a problem hiding this comment.
should we really force it all them time, even when encoding options are specified ? this forbids disabling the pretty printing
There was a problem hiding this comment.
rewrite this code, do not force pretty print now
There was a problem hiding this comment.
sound good to me thanks ^^
It's passed to json_encode function second argument.
|
Is there a reason to modify the existing test instead of adding an extra one that uses custom options? If I don't miss anything we wouldn't have a test for the default options anymore. |
It's passed to json_encode function second argument.