Skip to content

Commit 4d76c09

Browse files
committed
ADD TO: publish action / auto-generate table of contents
1 parent 630cf52 commit 4d76c09

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

wiki/Coding-Standard-Tutorial.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ In this tutorial, we will create a new coding standard with a single sniff. Our
22

33
Sniffs need to follow [strict directory layout and naming conventions](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/About-Standards-for-PHP_CodeSniffer#naming-conventions).
44

5+
## Table of contents
6+
7+
<!-- START doctoc -->
8+
<!-- END doctoc -->
9+
10+
***
11+
512
## Creating the Coding Standard Directory
613

714
All sniffs in PHP_CodeSniffer must belong to a coding standard. A coding standard is a directory with a specific sub-directory structure and a `ruleset.xml` file, so creating a standard is straight-forward.

wiki/Version-4.0-Developer-Upgrade-Guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Support for the JS/CSS tokenizers has been removed. To cause the least amount of
9696

9797
This has been implemented in this way to allow external standards to be cross-version compatible with PHPCS 3.x as well as 4.x for a while and to not force external standards to release a new major release to support PHPCS 4.0 (due to sniffs needing to be removed).
9898

99-
#### Upgrading
99+
**Upgrading**
100100

101101
Search for sniffs which specify the `public $supportedTokenizers` property to find sniffs which may need updating.
102102

@@ -118,7 +118,7 @@ Type casting for sniff property values set from within a ruleset has been made m
118118
* `null` will now be set to an actual `null` value. Previously, the sniff property would have been set to string `'null'`.
119119
* Array element values will now also get the type casting treatment. Previously, array values would always be strings.
120120

121-
#### Upgrading
121+
**Upgrading**
122122

123123
Search for sniff which have `public` properties which can be changed from within a ruleset.
124124

@@ -406,7 +406,7 @@ The `AbstractPatternSniff::__construct()` method no longer takes any arguments.
406406
Since PHPCS 1.4.0, the AbstractPatternSniff sets the `ignoreComments` option using a `public` var rather than through the constructor.
407407
This allows the setting to be overwritten in `ruleset.xml` files.
408408

409-
#### Upgrading
409+
**Upgrading**
410410

411411
* Search for sniffs which extend the `AbstractPatternSniff`.
412412
* If the sniff calls the `parent::__construct()` method with an argument, remove the argument.
@@ -533,7 +533,7 @@ The `protected` `getDeclarationNameWithNamespace()` and `getNamespaceOfScope()`
533533

534534
The Ruleset class now respects sniff selection via `--sniffs=...`, even when in a test context.
535535

536-
#### Upgrading
536+
**Upgrading**
537537

538538
If your own test framework contained work-arounds to get round the previous restriction, it should now be safe to remove those work-arounds and to use the `--sniffs=...` argument when initiating the `Config` class.
539539

@@ -585,7 +585,7 @@ If an external standard uses its own test framework, this section can be skipped
585585
For compatibility with the PHP_CodeSniffer native test framework, the directory layout conventions and class naming conventions for tests have to be strictly followed and external standards which want to use the PHPCS native test framework need to be registered in the PHP_CodeSniffer `CodeSniffer.conf` file.
586586
This is not really any different from before, just even more important now.
587587

588-
#### Upgrading
588+
**Upgrading**
589589

590590
In practice this means the following for most test suites for external standards which extend the PHP_CodeSniffer native test suite:
591591
1. In `composer.json`: update the PHPUnit version requirements.

0 commit comments

Comments
 (0)