Skip to content
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

Support changing YAML files #5

Closed
andreaswolf opened this issue Apr 8, 2024 · 1 comment · Fixed by #52
Closed

Support changing YAML files #5

andreaswolf opened this issue Apr 8, 2024 · 1 comment · Fixed by #52
Assignees

Comments

@andreaswolf
Copy link
Owner

Since YAML is a pretty widespread configuration syntax, changing it e.g. in the course of a project upgrade is a key feature. Therefore, Fractor should support that.

There is the symfony/yaml library for decoding and encoding YAML, but that does not give us an AST, and it does not preserve any formatting options.
Apart from that, I did not find any PHP YAML libraries that offer more features in a quick search.

There is https://www.npmjs.com/package/yaml-ast-parser and a newer fork https://www.npmjs.com/package/@stoplight/yaml-ast-parser which seem to support the relevant features.

@sabbelasichon
Copy link
Collaborator

We could start simple and just use the array structure of yaml but trying to keep the format with this neat little trick: https://github.com/sabbelasichon/typo3-rector/blob/1.x/src/FileProcessor/Yaml/YamlFileProcessor.php#L102C70-L102C83

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 a pull request may close this issue.

2 participants