https://github.com/nazar65/emacs-php-cs-fixer
Wraper for emacs php-cs-fixer
https://github.com/nazar65/emacs-php-cs-fixer
Last synced: 3 months ago
JSON representation
Wraper for emacs php-cs-fixer
- Host: GitHub
- URL: https://github.com/nazar65/emacs-php-cs-fixer
- Owner: Nazar65
- Created: 2022-03-25T15:49:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-19T20:57:39.000Z (about 1 year ago)
- Last Synced: 2025-01-18T05:44:05.214Z (5 months ago)
- Language: Emacs Lisp
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
A php-cs-fixer wrapper for the Emacs editor.
* Features
Allows in the /Emacs/ editor to fix most issues in /PHP/ code when
you want to follow the coding standards PSR-1 and PSR-2.Under the hood, this package provides the customisable /Elisp/ command
/php-cs-fix/ wich wraps the command line /php-cs-fixer/ *version >=2.0*
provided by the powerful [[http://cs.sensiolabs.org/][PHP Coding Standards Fixer]]* Installation
** System part
Using straight
#+BEGIN_SRC elisp
(use-package php-cs-fixer
:straight (:type git :repo "Nazar65/emacs-php-cs-fixer")
:after php-mode)
#+END_SRC
** Emacs partThis package requires that the `cl-lib` package was installed.
* Usage
Try /`M-x php-cs-fix [ret]`/ when editing a /PHP/ file.If you want an automatic fix when saving all php files, place this code in your /Emacs/ configuration file the line :
#+BEGIN_SRC elisp
(add-hook 'php-mode-hook
(lambda ()
(add-hook 'before-save-hook 'php-cs-fixer-before-save)))
#+END_SRC* Customisable variable
- php-cs-fixer-rules-config-file the 'php-cs-fixer' --config option value (default is nil) value is th path to .php-cs-fixer.dist.php file
- php-cs-fixer-command : the 'php-cs-fixer' command (default is "php-cs-fixer") ;Try /`M-x customize-group [ret] php-cs-fixer [ret]`/ to modify the values of these variables.