PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.1.0
Defender Security – Malware Scanner, Login Security & Firewall v3.1.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / src / extra / php-codesniffer-php-token / README.md

README.md in Defender Security – Malware Scanner, Login Security & Firewall 3.1.0, at src/extra/php-codesniffer-php-token/README.md

131 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 ## About
2
3 PHP_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
4
5 [](https://travis-ci.org/squizlabs/PHP_CodeSniffer![Build Status](https://travis-ci.org/squizlabs/PHP_CodeSniffer.svg?branch=phpcs-fixer)](https://travis-ci.org/squizlabs/PHP_CodeSniffer](https://travis-ci.org/squizlabs/PHP_CodeSniffer) [](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer![Code consistency](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer/grade.svg)](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer) [](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge![Join the chat at https://gitter.im/squizlabs/PHP_CodeSniffer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
7 ## Requirements
8
9 PHP_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-OptionsConfiguration Options manual page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements.
10
11 If you're using PHP_CodeSniffer as part of a team, or you're running it on a [](https://en.wikipedia.org/wiki/Continuous_integrationCI](https://en.wikipedia.org/wiki/Continuous_integration](https://en.wikipedia.org/wiki/Continuous_integration) server, you may want to configure your project's settings [](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-fileusing a configuration file](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file).
12
13
14 ## Installation
15
16 The easiest way to get started with PHP_CodeSniffer is to download the Phar files for each of the commands:
17 ```
18 # Download using curl
19 curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
20 curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
21
22 # Or download using wget
23 wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
24 wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
25
26 # Then test the downloaded PHARs
27 php phpcs.phar -h
28 php phpcbf.phar -h
29 ```
30
31 ### Composer
32 If you use Composer, you can install PHP_CodeSniffer system-wide with the following command:
33
34 composer global require "squizlabs/php_codesniffer=*"
35
36 Make sure you have the composer bin dir in your PATH. The default value is `~/.composer/vendor/bin/`, but you can check the value that you need to use by running `composer global config bin-dir --absolute`.
37
38 Or alternatively, include a dependency for `squizlabs/php_codesniffer` in your `composer.json` file. For example:
39
40 ```json
41 {
42 "require-dev": {
43 "squizlabs/php_codesniffer": "3.*"
44 }
45 }
46 ```
47
48 You will then be able to run PHP_CodeSniffer from the vendor bin directory:
49
50 ./vendor/bin/phpcs -h
51 ./vendor/bin/phpcbf -h
52
53 ### Phive
54 If you use Phive, you can install PHP_CodeSniffer as a project tool using the following commands:
55
56 phive install phpcs
57 phive install phpcbf
58
59 You will then be able to run PHP_CodeSniffer from the tools directory:
60
61 ./tools/phpcs -h
62 ./tools/phpcbf -h
63
64 ### PEAR
65 If you use PEAR, you can install PHP_CodeSniffer using the PEAR installer. This will make the `phpcs` and `phpcbf` commands immediately available for use. To install PHP_CodeSniffer using the PEAR installer, first ensure you have [](http://pear.php.net/manual/en/installation.getting.phpinstalled PEAR](http://pear.php.net/manual/en/installation.getting.php](http://pear.php.net/manual/en/installation.getting.php) and then run the following command:
66
67 pear install PHP_CodeSniffer
68
69 ### Git Clone
70 You can also download the PHP_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone:
71
72 git clone https://github.com/squizlabs/PHP_CodeSniffer.git
73 cd PHP_CodeSniffer
74 php bin/phpcs -h
75 php bin/phpcbf -h
76
77 ## Getting Started
78
79 The default coding standard used by PHP_CodeSniffer is the PEAR coding standard. To check a file against the PEAR coding standard, simply specify the file's location:
80
81 $ phpcs /path/to/code/myfile.php
82
83 Or if you wish to check an entire directory you can specify the directory location instead of a file.
84
85 $ phpcs /path/to/code-directory
86
87 If you wish to check your code against the PSR-2 coding standard, use the `--standard` command line argument:
88
89 $ phpcs --standard=PSR2 /path/to/code-directory
90
91 If PHP_CodeSniffer finds any coding standard errors, a report will be shown after running the command.
92
93 Full usage information and example reports are available on the [](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usageusage page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage).
94
95 ## Documentation
96
97 The documentation for PHP_CodeSniffer is available on the [](https://github.com/squizlabs/PHP_CodeSniffer/wikiGithub wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki).
98
99 ## Issues
100
101 Bug reports and feature requests can be submitted on the [](https://github.com/squizlabs/PHP_CodeSniffer/issuesGithub Issue Tracker](https://github.com/squizlabs/PHP_CodeSniffer/issues](https://github.com/squizlabs/PHP_CodeSniffer/issues).
102
103 ## Contributing
104
105 See [](CONTRIBUTING.mdCONTRIBUTING.md](CONTRIBUTING.md](CONTRIBUTING.md) for information.
106
107 ## Versioning
108
109 PHP_CodeSniffer uses a `MAJOR.MINOR.PATCH` version number format.
110
111 The `MAJOR` version is incremented when:
112 - backwards-incompatible changes are made to how the `phpcs` or `phpcbf` commands are used, or
113 - backwards-incompatible changes are made to the `ruleset.xml` format, or
114 - backwards-incompatible changes are made to the API used by sniff developers, or
115 - custom PHP_CodeSniffer token types are removed, or
116 - existing sniffs are removed from PHP_CodeSniffer entirely
117
118 The `MINOR` version is incremented when:
119 - new backwards-compatible features are added to the `phpcs` and `phpcbf` commands, or
120 - backwards-compatible changes are made to the `ruleset.xml` format, or
121 - backwards-compatible changes are made to the API used by sniff developers, or
122 - new sniffs are added to an included standard, or
123 - existing sniffs are removed from an included standard
124
125 > NOTE: Backwards-compatible changes to the API used by sniff developers will allow an existing sniff to continue running without producing fatal errors but may not result in the sniff reporting the same errors as it did previously without changes being required.
126
127 The `PATCH` version is incremented when:
128 - backwards-compatible bug fixes are made
129
130 > NOTE: As PHP_CodeSniffer exists to report and fix issues, most bugs are the result of coding standard errors being incorrectly reported or coding standard errors not being reported when they should be. This means that the messages produced by PHP_CodeSniffer, and the fixes it makes, are likely to be different between PATCH versions.
131