Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tassilogroeper
Copy link

See issue #211

@@ -12,6 +12,11 @@

class ObjectDriver implements Driver
{
public function __construct(
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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!

Copy link
Author

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!

@freekmurze
Copy link
Member

The tests are failing, could you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants