DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:coding_style

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
devel:coding_style [2023-09-02 14:04] – fixme Klap-indevel:coding_style [2023-11-13 21:13] (current) – [Checking for Coding Style Violations] andi
Line 73: Line 73:
  
 ===== Checking for Coding Style Violations ===== ===== Checking for Coding Style Violations =====
-FIXME 
  
 Code styles can be checked with [[https://github.com/squizlabs/PHP_CodeSniffer|PHP_CodeSniffer]]. A configuration file is located in the ''_test'' directory. Code styles can be checked with [[https://github.com/squizlabs/PHP_CodeSniffer|PHP_CodeSniffer]]. A configuration file is located in the ''_test'' directory.
Line 79: Line 78:
 === Setup === === Setup ===
  
-To install PHP_CodeSniffer best download the phar files:+Install via [[composer]]:
  
     cd _test     cd _test
-    wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar +    composer install
-    wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar+
  
  
Line 92: Line 90:
     # Check a single file     # Check a single file
     cd _test     cd _test
-    php phpcs.phar ../path/to/myfile.php+    composer check ../path/to/myfile.php
          
     # Check all files in a directory     # Check all files in a directory
     cd _test     cd _test
-    php phpcs.phar ../path/to/directory+    composer check ../path/to/directory
  
devel/coding_style.txt · Last modified: 2023-11-13 21:13 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki