PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.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 6.3.0, at src/extra/php-codesniffer-php-token/README.md

156 lines 6.3 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
4 detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard
5 violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
6
7 [](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)
8
9 ## Requirements
10
11 PHP_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such
12 as external applications and scripts. See
13 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
14 list of these requirements.
15
16 If you're using PHP_CodeSniffer as part of a team, or you're running it on
17 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
18 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).
19
20 ## Installation
21
22 The easiest way to get started with PHP_CodeSniffer is to download the Phar files for each of the commands:
23
24 ```
25 # Download using curl
26 curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
27 curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
28
29 # Or download using wget
30 wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
31 wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
32
33 # Then test the downloaded PHARs
34 php phpcs.phar -h
35 php phpcbf.phar -h
36 ```
37
38 ### Composer
39
40 If you use Composer, you can install PHP_CodeSniffer system-wide with the following command:
41
42 composer global require "squizlabs/php_codesniffer=*"
43
44 Make sure you have the composer bin dir in your PATH. The default value is `~/.composer/vendor/bin/`, but you can check
45 the value that you need to use by running `composer global config bin-dir --absolute`.
46
47 Or alternatively, include a dependency for `squizlabs/php_codesniffer` in your `composer.json` file. For example:
48
49 ```json
50 {
51 "require-dev": {
52 "squizlabs/php_codesniffer": "3.*"
53 }
54 }
55 ```
56
57 You will then be able to run PHP_CodeSniffer from the vendor bin directory:
58
59 ./vendor/bin/phpcs -h
60 ./vendor/bin/phpcbf -h
61
62 ### Phive
63
64 If you use Phive, you can install PHP_CodeSniffer as a project tool using the following commands:
65
66 phive install phpcs
67 phive install phpcbf
68
69 You will then be able to run PHP_CodeSniffer from the tools directory:
70
71 ./tools/phpcs -h
72 ./tools/phpcbf -h
73
74 ### PEAR
75
76 If you use PEAR, you can install PHP_CodeSniffer using the PEAR installer. This will make the `phpcs` and `phpcbf`
77 commands immediately available for use. To install PHP_CodeSniffer using the PEAR installer, first ensure you
78 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:
79
80 pear install PHP_CodeSniffer
81
82 ### Git Clone
83
84 You can also download the PHP_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone:
85
86 git clone https://github.com/squizlabs/PHP_CodeSniffer.git
87 cd PHP_CodeSniffer
88 php bin/phpcs -h
89 php bin/phpcbf -h
90
91 ## Getting Started
92
93 The default coding standard used by PHP_CodeSniffer is the PEAR coding standard. To check a file against the PEAR coding
94 standard, simply specify the file's location:
95
96 $ phpcs /path/to/code/myfile.php
97
98 Or if you wish to check an entire directory you can specify the directory location instead of a file.
99
100 $ phpcs /path/to/code-directory
101
102 If you wish to check your code against the PSR-2 coding standard, use the `--standard` command line argument:
103
104 $ phpcs --standard=PSR2 /path/to/code-directory
105
106 If PHP_CodeSniffer finds any coding standard errors, a report will be shown after running the command.
107
108 Full usage information and example reports are available on
109 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).
110
111 ## Documentation
112
113 The documentation for PHP_CodeSniffer is available on
114 the [](https://github.com/squizlabs/PHP_CodeSniffer/wikiGithub wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki).
115
116 ## Issues
117
118 Bug reports and feature requests can be submitted on
119 the [](https://github.com/squizlabs/PHP_CodeSniffer/issuesGithub Issue Tracker](https://github.com/squizlabs/PHP_CodeSniffer/issues](https://github.com/squizlabs/PHP_CodeSniffer/issues).
120
121 ## Contributing
122
123 See [](CONTRIBUTING.mdCONTRIBUTING.md](CONTRIBUTING.md](CONTRIBUTING.md) for information.
124
125 ## Versioning
126
127 PHP_CodeSniffer uses a `MAJOR.MINOR.PATCH` version number format.
128
129 The `MAJOR` version is incremented when:
130
131 - backwards-incompatible changes are made to how the `phpcs` or `phpcbf` commands are used, or
132 - backwards-incompatible changes are made to the `ruleset.xml` format, or
133 - backwards-incompatible changes are made to the API used by sniff developers, or
134 - custom PHP_CodeSniffer token types are removed, or
135 - existing sniffs are removed from PHP_CodeSniffer entirely
136
137 The `MINOR` version is incremented when:
138
139 - new backwards-compatible features are added to the `phpcs` and `phpcbf` commands, or
140 - backwards-compatible changes are made to the `ruleset.xml` format, or
141 - backwards-compatible changes are made to the API used by sniff developers, or
142 - new sniffs are added to an included standard, or
143 - existing sniffs are removed from an included standard
144
145 > NOTE: Backwards-compatible changes to the API used by sniff developers will allow an existing sniff to continue
146 > running without producing fatal errors but may not result in the sniff reporting the same errors as it did previously
147 > without changes being required.
148
149 The `PATCH` version is incremented when:
150
151 - backwards-compatible bug fixes are made
152
153 > NOTE: As PHP_CodeSniffer exists to report and fix issues, most bugs are the result of coding standard errors being
154 > incorrectly reported or coding standard errors not being reported when they should be. This means that the messages
155 > produced by PHP_CodeSniffer, and the fixes it makes, are likely to be different between PATCH versions.
156