User Tools

Site Tools


php:phpcsfixer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
php:phpcsfixer [2023/04/29 14:34] – removed - external edit (Unknown date) 127.0.0.1php:phpcsfixer [2023/05/29 11:55] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== PHP CS Fixer ======
 +
 +The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP coding standards as defined in the PSR-1, PSR-2, etc., or other community driven ones like the Symfony one. You can also define your (team's) style through configuration.
 +
 +https://github.com/FriendsOfPHP/PHP-CS-Fixer
 +
 +Install (global):
 +<code>
 +wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
 +sudo chmod a+x php-cs-fixer
 +sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer
 +</code>
 +
 +update (global):
 +<code>
 +sudo php-cs-fixer self-update
 +</code>
 +
 +Usage in dry run mode:
 +<code>
 +php-cs-fixer fix /path/to/code --dry-run
 +</code>
 +
 +
 +===== Sublime Text Plugin =====
 +
 +Installing Package Control
 +
 +  * The simplest method of installing the Package Control plugin is through Sublime Text itself. 
 +  * Open Sublime Text and open the Command Palette... by selecting Command Palette from the Tools pull-down menu. 
 +  * In the menu that opens type install which will result in the Install Package Control option being presented. 
 +  * Hit Enter or left click the entry to install Package Control.
 +
 +Installing Packages
 +
 +  * Open the Command Palette... by selecting Command Palette from the Tools pull-down menu.
 +  * In the popup window that appears type Install to search for the install option through Package Control. 
 +  * When Package Control: Install Package is highlighted press Return. 
 +  * You can use the arrow keys to move the selected option.
 +
 +Plugin name: "PHP CS Fixer"
 +
 +Config info:\\ 
 +https://github.com/adael/SublimePhpCsFixer
 +
 +
 +===== VSCode plugins =====
 +
 +https://gruz.ml/en/tech-blog/joomla-tips-and-tricks/118-vs-code-joomla-coding-standards-php-linting-via-phpcs-and-php-cs-fixer.html