Skip to content

Wiki: always use fully qualified links #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions wiki/Advanced-Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ $ phpcs --tab-width=4 /path/to/code

> [!NOTE]
> 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.
> When using a [[custom ruleset.xml file|Annotated ruleset]], only enable one of these two sniffs, never both.
> 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.

<p align="right"><a href="#table-of-contents">back to top</a></p>

Expand Down Expand Up @@ -275,7 +275,7 @@ If you run PHP_CodeSniffer without specifying a coding standard, PHP_CodeSniffer
> [!IMPORTANT]
> 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`

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.
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.

> [!NOTE]
> 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)
Expand All @@ -302,7 +302,7 @@ $ phpcs -d memory_limit=32M -d include_path=.:/php/includes /path/to/code

## Setting Configuration Options

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|Configuration Options]].
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).

To set a configuration option, use the `--config-set` command line argument.

Expand All @@ -317,14 +317,14 @@ $ phpcs --runtime-set <option> <value> /path/to/code
```

> [!NOTE]
> 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|Configuration Options]] list provides an alternative CLI argument for each configuration option not supported by `--runtime-set`.
> 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`.

<p align="right"><a href="#table-of-contents">back to top</a></p>


## Deleting Configuration Options

PHP_CodeSniffer allows you to delete any configuration option, reverting it to its default value. [[View a full list of configuration options|Configuration Options]].
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).

To delete a configuration option, use the `--config-delete` command line argument.

Expand Down
2 changes: 1 addition & 1 deletion wiki/Coding-Standard-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The content of the `ruleset.xml` file should, at a minimum, be the following:
```

> [!NOTE]
> 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]].
> 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).

## Creating the Sniff

Expand Down
2 changes: 1 addition & 1 deletion wiki/Customisable-Sniff-Properties.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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.

For more information about changing sniff behaviour by customising your ruleset, see the [[Annotated ruleset]].
For more information about changing sniff behaviour by customising your ruleset, see the [Annotated ruleset](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset).

## Table of contents

Expand Down
4 changes: 2 additions & 2 deletions wiki/Home.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PHP_CodeSniffer is a set of two PHP scripts:
1. the main [`phpcs` script](wiki/Usage) that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard; and
2. a [`phpcbf` script](wiki/Fixing-Errors-Automatically) to automatically correct detected coding standard violations.
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
2. a [`phpcbf` script](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically) to automatically correct detected coding standard violations.

PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

Expand Down
2 changes: 1 addition & 1 deletion wiki/Reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ File,Line,Column,Type,Message,Source,Severity,Fixable
## Printing a Diff Report

> [!TIP]
> Use the [`phpcbf` script](wiki/Fixing-Errors-Automatically) instead to automatically fix scanned files.
> Use the [`phpcbf` script](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically) instead to automatically fix scanned files.

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:

Expand Down
2 changes: 1 addition & 1 deletion wiki/Requirements.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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.
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.

Additionally, PHP_CodeSniffer requires the following PHP extensions to be enabled:
- Tokenizer: used by the core tokenizer to process PHP files
Expand Down
4 changes: 2 additions & 2 deletions wiki/Version-4.0-Developer-Upgrade-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PHP_CodeSniffer version 4.0.0 contains a number of core changes and breaks backw
> [!NOTE]
> A certain level of technical understanding of PHP_CodeSniffer is presumed for readers of this upgrade guide.

There is a separate [[Upgrade Guide for Ruleset Maintainers and End-Users|Version 4.0 User Upgrade Guide]] available.
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.


## Table of contents
Expand Down Expand Up @@ -73,7 +73,7 @@ The vast majority of the below upgrade tasks will need to be executed in both ca

## Upgrading the ruleset.xml file

See the [[Upgrade Guide for Ruleset Maintainers and End-Users|Version 4.0 User Upgrade Guide]] for everything you need to know about upgrading the `ruleset.xml` file.
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.

<p align="right"><a href="#table-of-contents">back to top</a></p>

Expand Down
2 changes: 1 addition & 1 deletion wiki/Version-4.0-User-Upgrade-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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.

There is a separate [[Upgrade Guide for Sniff Developers and Integrators|Version 4.0 Developer Upgrade Guide]] available.
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.

## Table of contents

Expand Down