-
-
Notifications
You must be signed in to change notification settings - Fork 74
Allow setting yamlInline for ObjectDriver #212
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
Allow setting yamlInline for ObjectDriver #212
Conversation
@@ -12,6 +12,11 @@ | |||
|
|||
class ObjectDriver implements Driver | |||
{ | |||
public function __construct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this single parameter, let's allow passing an array with options.
The default options should be
'yaml_inline' => 2,
'yaml_indent' => 4,
'yaml_flags' => Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK,
Any options passed should be merged with the defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also thought about it. fine with me.
However, I had a hard time, testing the indentation. The dedent function does behave, like I expected.
E.g. When setting the intent to 2 only the first line is corrected, but the others are still indented by 4 ?!
If you are fine to have a test for only the inline var, I can do it in my PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are fine to have a test for only the inline var, I can do it in my PR.
That's ok!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Requested changes are done!
The tests are failing, could you take a look? |
@freekmurze Sorry, but the tests are failing on an unrelated file in PHP 8.4, not subject to my changes AFAIK. Is it possible, |
I've fixed the tests on |
…pdate serialization method to use it
7535cb2
to
f4ac407
Compare
@freekmurze whohooo! Tests are green again |
Thank you very much! |
See issue #211