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

Integrate php-cs-fixer #616

Closed
someonewithpc opened this issue Mar 23, 2020 · 3 comments
Closed

Integrate php-cs-fixer #616

someonewithpc opened this issue Mar 23, 2020 · 3 comments
Assignees
Labels

Comments

@someonewithpc
Copy link

someonewithpc commented Mar 23, 2020

I think it would be beneficial to include https://github.com/OVYA/php-cs-fixer with php-mode. I, however, have my own fork, which I believe works better and in a more straightforward way, at https://github.com/someonewithpc/php-cs-fixer

I opened a pull request in the original project, but it was rejected as "too extreme", which is fair, but their version did not work for me.

I'm open to make a pull request, but I'd like comments on which version is considered more appropriate.

@zonuexe zonuexe self-assigned this Mar 23, 2020
@zonuexe
Copy link
Member

zonuexe commented Mar 8, 2023

@someonewithpc
php-format.el was merged by #731. php-format-auto-mode probably covers your use case. Not well documented yet, but should work easily if your project has .php-cs-fixer.dist.php or php-cs-fixer.php file.

Please give me feedback if you have any thoughts on the user experience of this mode. thank you!

@zonuexe zonuexe closed this as completed Mar 8, 2023
@NateEag
Copy link
Member

NateEag commented Mar 8, 2023

apheleia-mode is a general package for using code formatters asynchronously, which people viewing this issue may be interested in.

I'm not currently writing PHP, but next time I am, I'll be tweaking my configuration to apply PHP code formatters via apheleia-mode.

@zonuexe
Copy link
Member

zonuexe commented Mar 8, 2023

@NateEag
Thanks for suggesting!

PHP formatters tend to rewrite files directly instead of supporting stdin. I also implemented it by applying the RCS patch at first, but I was able to edit it more smoothly by starting the process asynchronously from the timer.

Since the way the autoformat results are reflected in the Emacs buffer is a matter of user choice and preference, we will also document other options.

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

No branches or pull requests

3 participants