Skip to content

Nazar65/emacs-php-cs-fixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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 PHP Coding Standards Fixer

Installation

System part

Using straight

(use-package php-cs-fixer
  :straight (:type git :repo "Nazar65/emacs-php-cs-fixer")
  :after php-mode)

Emacs part

This 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 :

(add-hook 'php-mode-hook
            (lambda ()
              (add-hook 'before-save-hook 'php-cs-fixer-before-save)))

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.

About

Wraper for emacs php-cs-fixer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published