Add default config for php-cs-fixer and a hook to run it on save.

This commit is contained in:
kj
2025-09-05 20:47:34 -03:00
parent 96b0ccf056
commit d1ddd81282

View File

@ -30,7 +30,22 @@
;; PHPUnit
(use-package phpunit)
(use-package php-cs-fixer)
(use-package php-cs-fixer
:custom
(php-cs-fixer-rules-level-part-options (list (json-encode '(("@PSR12" . t)
("ordered_imports" . (("sort_algorithm" . "alpha")))
("concat_space" . (("spacing" . "one")))
("whitespace_after_comma_in_array" . t)
("align_multiline_comment" . t)
("no_unused_imports" . t)
("phpdoc_align" . t)
("phpdoc_indent" . t)
("no_useless_return" . t)
("return_assignment" . t)
("trailing_comma_in_multiline" . t)))))
(php-cs-fixer-rules-fixer-part-options '())
:hook (before-save . php-cs-fixer-before-save)
)
(provide 'lang-php)
;;; lang-php.el ends here