You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> The `Generic.WhiteSpace.DisallowTabIndent` and `Generic.WhiteSpace.DisallowSpaceIndent` sniffs, which enforce space or tab indentation respectively, will still generate errors, even if you have replaced tabs with spaces using the `--tab-width` setting. These sniffs looks at the unmodified version of the code to check line indentation.
227
-
> When using a [[custom ruleset.xml file|Annotated ruleset]], only enable one of these two sniffs, never both.
227
+
> When using a [custom `ruleset.xml` file](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset), only enable one of these two sniffs, never both.
228
228
229
229
<palign="right"><ahref="#table-of-contents">back to top</a></p>
230
230
@@ -258,7 +258,7 @@ If you run PHP_CodeSniffer without specifying a coding standard, PHP_CodeSniffer
258
258
> [!IMPORTANT]
259
259
> If multiple default configuration files are found, PHP_CodeSniffer will select one using the following order: `.phpcs.xml`, `phpcs.xml`, `.phpcs.xml.dist`, `phpcs.xml.dist`
260
260
261
-
The `phpcs.xml` file has exactly the same format as a normal [[ruleset.xml file|Annotated ruleset]], so all the same options are available in it. The `phpcs.xml` file essentially acts as a default coding standard and configuration file for a code base, and is typically used to allow the `phpcs` command to be run on a repository without specifying any arguments.
261
+
The `phpcs.xml` file has exactly the same format as a normal [`ruleset.xml` file](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset), so all the same options are available in it. The `phpcs.xml` file essentially acts as a default coding standard and configuration file for a code base, and is typically used to allow the `phpcs` command to be run on a repository without specifying any arguments.
262
262
263
263
> [!NOTE]
264
264
> An example `phpcs.xml` file can be found in the PHP_CodeSniffer repository: [phpcs.xml.dist](https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xml.dist)
PHP_CodeSniffer has some configuration options that can be set. Individual coding standards may also require configuration options to be set before functionality can be used. [[View a full list of configuration options|ConfigurationOptions]].
288
+
PHP_CodeSniffer has some configuration options that can be set. Individual coding standards may also require configuration options to be set before functionality can be used. [View a full list of configuration options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options).
289
289
290
290
To set a configuration option, use the `--config-set` command line argument.
> Not all configuration options can be set using the `--runtime-set` command line argument. Configuration options that provide defaults for command line arguments, such as the default standard or report type, can not be used with `--runtime-set`. To set these values for a single run only, use the dedicated CLI arguments that PHP_CodeSniffer provides. The [[Configuration Options|ConfigurationOptions]] list provides an alternative CLI argument for each configuration option not supported by `--runtime-set`.
303
+
> Not all configuration options can be set using the `--runtime-set` command line argument. Configuration options that provide defaults for command line arguments, such as the default standard or report type, can not be used with `--runtime-set`. To set these values for a single run only, use the dedicated CLI arguments that PHP_CodeSniffer provides. The [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) list provides an alternative CLI argument for each configuration option not supported by `--runtime-set`.
304
304
305
305
<palign="right"><ahref="#table-of-contents">back to top</a></p>
306
306
307
307
308
308
## Deleting Configuration Options
309
309
310
-
PHP_CodeSniffer allows you to delete any configuration option, reverting it to its default value. [[View a full list of configuration options|ConfigurationOptions]].
310
+
PHP_CodeSniffer allows you to delete any configuration option, reverting it to its default value. [View a full list of configuration options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options).
311
311
312
312
To delete a configuration option, use the `--config-delete` command line argument.
Copy file name to clipboardExpand all lines: wiki/Coding-Standard-Tutorial.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ The content of the `ruleset.xml` file should, at a minimum, be the following:
44
44
```
45
45
46
46
> [!NOTE]
47
-
> The ruleset.xml can be left quite small, as it is in this example coding standard. For information about the other features that the `ruleset.xml` provides, see the [[Annotated ruleset]].
47
+
> The ruleset.xml can be left quite small, as it is in this example coding standard. For information about the other features that the `ruleset.xml` provides, see the [Annotated ruleset](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset).
48
48
49
49
<palign="right"><ahref="#table-of-contents">back to top</a></p>
Copy file name to clipboardExpand all lines: wiki/Customisable-Sniff-Properties.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
The behaviour of some sniffs can be changed by setting certain sniff properties in your ruleset.xml file. This page lists the sniff properties that are available for customisation. For properties that were added after ruleset support was introduced in version 1.3.0, the first stable version that made the property available is listed.
2
2
3
-
For more information about changing sniff behaviour by customising your ruleset, see the [[Annotated ruleset]].
3
+
For more information about changing sniff behaviour by customising your ruleset, see the [Annotated ruleset](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset).
Copy file name to clipboardExpand all lines: wiki/Home.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
PHP_CodeSniffer is a set of two PHP scripts:
2
-
1. the main [`phpcs` script](wiki/Usage) that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard; and
3
-
2. a [`phpcbf` script](wiki/Fixing-Errors-Automatically) to automatically correct detected coding standard violations.
2
+
1. the main [`phpcs` script](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage) that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard; and
3
+
2. a [`phpcbf` script](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically) to automatically correct detected coding standard violations.
4
4
5
5
PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
> Use the [`phpcbf` script](wiki/Fixing-Errors-Automatically) instead to automatically fix scanned files.
305
+
> Use the [`phpcbf` script](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically) instead to automatically fix scanned files.
306
306
307
307
PHP_CodeSniffer can output a diff file that can be applied using the `patch` command. The suggested changes will fix some of the sniff violations that are present in the source code. To print a diff report, use the `--report=diff` command line argument. The output will look like this:
Copy file name to clipboardExpand all lines: wiki/Requirements.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
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 [[Configuration Options]] manual page for a list of these requirements.
1
+
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 [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) manual page for a list of these requirements.
2
2
3
3
Additionally, PHP_CodeSniffer requires the following PHP extensions to be enabled:
4
4
- Tokenizer: used by the core tokenizer to process PHP files
Copy file name to clipboardExpand all lines: wiki/Version-4.0-Developer-Upgrade-Guide.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ PHP_CodeSniffer version 4.0.0 contains a number of core changes and breaks backw
9
9
> [!NOTE]
10
10
> A certain level of technical understanding of PHP_CodeSniffer is presumed for readers of this upgrade guide.
11
11
12
-
There is a separate [[Upgrade Guide for Ruleset Maintainers and End-Users|Version4.0UserUpgradeGuide]] available.
12
+
There is a separate [Upgrade Guide for Ruleset Maintainers and End-Users](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Version-4.0-User-Upgrade-Guide) available.
13
13
14
14
15
15
## Table of contents
@@ -45,7 +45,7 @@ The vast majority of the below upgrade tasks will need to be executed in both ca
45
45
46
46
## Upgrading the ruleset.xml file
47
47
48
-
See the [[Upgrade Guide for Ruleset Maintainers and End-Users|Version4.0UserUpgradeGuide]] for everything you need to know about upgrading the `ruleset.xml` file.
48
+
See the [Upgrade Guide for Ruleset Maintainers and End-Users](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Version-4.0-User-Upgrade-Guide) for everything you need to know about upgrading the `ruleset.xml` file.
49
49
50
50
<palign="right"><ahref="#table-of-contents">back to top</a></p>
Copy file name to clipboardExpand all lines: wiki/Version-4.0-User-Upgrade-Guide.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
PHP_CodeSniffer version 4.0.0 contains a number of core changes and breaks backwards compatibility in select situations. The aim of this guide is to help **ruleset maintainers and end-users** to upgrade from PHP_CodeSniffer version 3.x to version 4.x.
8
8
9
-
There is a separate [[Upgrade Guide for Sniff Developers and Integrators|Version4.0DeveloperUpgradeGuide]] available.
9
+
There is a separate [Upgrade Guide for Sniff Developers and Integrators](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Version-4.0-Developer-Upgrade-Guide) available.
0 commit comments