Skip to content

Commit 1d0576c

Browse files
committed
Wiki: various grammar and spelling fixes
1 parent ad2ae7a commit 1d0576c

10 files changed

+38
-38
lines changed

wiki/About-Standards-for-PHP_CodeSniffer.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ The typical differences between project-specific rulesets and standards are:
3434
| Will automatically be used when no standard is provided on the command line ? | Yes | No |
3535
| Can have custom sniffs ? | No | Yes |
3636
| Can be installed ? | No | Yes |
37-
| Reusability by other projects ? | Limited | Yes |
37+
| Re-usability by other projects ? | Limited | Yes |
3838

39-
For optimal reusability, it is in most cases a good idea for a standard to be in its own repository and to be maintained as a separate project.
39+
For optimal re-usability, it is in most cases a good idea for a standard to be in its own repository and to be maintained as a separate project.
4040

4141
A `[.]phpcs.xml[.dist]` file and a `ruleset.xml` file can largely contain the same type of directives.
4242
The [Annotated ruleset](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset) page contains information on all the directives you can use.
4343

44-
Keep in mind that for a _standard_ to be optimally reusable, it should not contain project specific information, such as `<file>` directives or `<exclude-patterns>`, while a project specific `[.]phpcs.xml[.dist]` ruleset file _can_ contain that information.
44+
Keep in mind that for a _standard_ to be optimally re-usable, it should not contain project specific information, such as `<file>` directives or `<exclude-patterns>`, while a project specific `[.]phpcs.xml[.dist]` ruleset file _can_ contain that information.
4545

4646
You may also find the [Customisable Sniff Properties](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties) page a handy reference for customisations which can be made to PHP_CodeSniffer native sniffs.
4747

@@ -253,7 +253,7 @@ use PHP_CodeSniffer\Sniffs\Sniff;
253253
class OperatorSpacingSniff implements Sniff {...}
254254
```
255255

256-
:x: Not following the required directory structure (missing `[CategoryName]` subdirectory):
256+
:x: Not following the required directory structure (missing `[CategoryName]` sub-directory):
257257
```php
258258
<?php
259259
// File: MyStandard/Sniffs/OperatorSpacingSniff.php

wiki/Advanced-Usage.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ $ phpcs --encoding=windows-1251 /path/to/code
259259

260260
## Using a Bootstrap File
261261

262-
PHP_CodeSniffer can optionally include one or more custom bootstrap files before beginning the run. Bootstrap files are included after command line arguments and rulesets have been parsed, and right before files begin to process. These custom files may be used to perform such taks as manipulating the internal settings of PHP_CodeSniffer that are not exposed through command line arguments. Multiple bootstrap files are seperated by commas.
262+
PHP_CodeSniffer can optionally include one or more custom bootstrap files before beginning the run. Bootstrap files are included after command line arguments and rulesets have been parsed, and right before files begin to process. These custom files may be used to perform such tasks as manipulating the internal settings of PHP_CodeSniffer that are not exposed through command line arguments. Multiple bootstrap files are separated by commas.
263263

264264
```bash
265-
$ phpcs --bootstrap=/path/to/boostrap.1.inc,/path/to/bootstrap.2.inc /path/to/code
265+
$ phpcs --bootstrap=/path/to/bootstrap.1.inc,/path/to/bootstrap.2.inc /path/to/code
266266
```
267267

268268
<p align="right"><a href="#table-of-contents">back to top</a></p>
@@ -351,13 +351,13 @@ Array
351351
<p align="right"><a href="#table-of-contents">back to top</a></p>
352352

353353

354-
## Printing Verbose Tokeniser Output
354+
## Printing Verbose Tokenizer Output
355355

356356
This feature is provided for debugging purposes only. Using this feature will dramatically increase screen output and script running time.
357357

358-
PHP_CodeSniffer contains multiple verbosity levels. Level 2 (indicated by the command line argument `-vv`) will print all verbosity information for level 1 (file specific token and line counts with running times) as well as verbose tokeniser output.
358+
PHP_CodeSniffer contains multiple verbosity levels. Level 2 (indicated by the command line argument `-vv`) will print all verbosity information for level 1 (file specific token and line counts with running times) as well as verbose tokenizer output.
359359

360-
The output of the PHP_CodeSniffer tokeniser shows the step-by-step creation of the scope map and the level map.
360+
The output of the PHP_CodeSniffer tokenizer shows the step-by-step creation of the scope map and the level map.
361361

362362
### The Scope Map
363363

@@ -456,7 +456,7 @@ The level map is most commonly used to determine indentation rules (e.g., a toke
456456

457457
This feature is provided for debugging purposes only. Using this feature will dramatically increase screen output and script running time.
458458

459-
PHP_CodeSniffer contains multiple verbosity levels. Level 3 (indicated by the command line argument `-vvv`) will print all verbosity information for level 1 (file specific token and line counts with running times), level 2 (tokeniser output) as well as token processing output with sniff running times.
459+
PHP_CodeSniffer contains multiple verbosity levels. Level 3 (indicated by the command line argument `-vvv`) will print all verbosity information for level 1 (file specific token and line counts with running times), level 2 (tokenizer output) as well as token processing output with sniff running times.
460460

461461
The token processing output is best explained with an example. For the following file:
462462

wiki/Annotated-Ruleset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ The following sample file documents the ruleset.xml format and shows you the com
133133
directory because it does not exist inside the PHP_CodeSniffer
134134
install directory.
135135
-->
136-
<rule ref="/home/username/standards/mystandard"/>
136+
<rule ref="/home/username/standards/MyStandard"/>
137137

138138
<!--
139139
Include everything in another ruleset.xml file. This is
@@ -148,7 +148,7 @@ The following sample file documents the ruleset.xml format and shows you the com
148148
Make sure the reference starts with ./ or ../ so PHP_CodeSniffer
149149
knows it is a relative path.
150150
-->
151-
<rule ref="./standards/mystandard"/>
151+
<rule ref="./standards/MyStandard"/>
152152
<rule ref="../username/custom.xml"/>
153153

154154
<!--

wiki/Coding-Standard-Tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ final class DisallowHashCommentsSniff implements Sniff
121121
}
122122
```
123123

124-
By default, PHP_CodeSniffer assumes all sniffs are designed to check PHP code only. You can specify a list of tokenizers that your sniff supports, allowing it to be used wth PHP, JavaScript or CSS files, or any combination of the three. You do this by setting the `$supportedTokenizers` property in your sniff. Adding the following code to your sniff will tell PHP_CodeSniffer that it can be used to check both PHP and JavaScript code:
124+
By default, PHP_CodeSniffer assumes all sniffs are designed to check PHP code only. You can specify a list of tokenizers that your sniff supports, allowing it to be used with PHP, JavaScript or CSS files, or any combination of the three. You do this by setting the `$supportedTokenizers` property in your sniff. Adding the following code to your sniff will tell PHP_CodeSniffer that it can be used to check both PHP and JavaScript code:
125125

126126
```php
127127
/**

wiki/Configuration-Options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ $ phpcs --config-set ignore_warnings_on_exit 1
238238
239239
## Ignoring non-auto-fixable issues when generating the exit code (PHP_CodeSniffer >= 4.0.0)
240240
241-
By default, PHP_CodeSniffer will exit with a non-zero code if any errors or warnings are found, whethere these are auto-fixable or not.
242-
If you want to display non-autofixable errors and warnings to the user, but still return with a zero exit code if non-auto-fixable issues are found, you can set the `ignore_non_auto_fixable_on_exit` configuration option.
241+
By default, PHP_CodeSniffer will exit with a non-zero code if any errors or warnings are found, whether these are auto-fixable or not.
242+
If you want to display non-auto-fixable errors and warnings to the user, but still return with a zero exit code if non-auto-fixable issues are found, you can set the `ignore_non_auto_fixable_on_exit` configuration option.
243243
This option is typically used by automated build tools so that a `phpcbf` run can exit with `0` if it fixed all fixable issues, but there are still some non-auto-fixable issues remaining.
244244
245245
```bash

wiki/Customisable-Sniff-Properties.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ This sniff ensures that parameters passed to a function are used within that fun
103103
```php
104104
public function execute(InputInterface $input, OutputInterface $output): int
105105
{
106-
$output->writeln('Hello World!');
106+
$output->writeLine('Hello World!');
107107
}
108108
```
109109

@@ -973,7 +973,7 @@ $rootNode
973973
->end()
974974
->end();
975975
```
976-
If you want to allow mutli-level indenting, set the `multilevel` property to `true`. This will allow each line to be indented 1 more or 1 less level than the previous line, while still ensuring that all lines are indented at least once.
976+
If you want to allow multi-level indenting, set the `multilevel` property to `true`. This will allow each line to be indented 1 more or 1 less level than the previous line, while still ensuring that all lines are indented at least once.
977977

978978
```xml
979979
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent">

wiki/Reporting.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,14 @@ patching file /path/to/code/file.php
333333
```
334334
335335
> [!NOTE]
336-
> The `*nix` `diff` command is required for generating reports in `diff` format. Windows users may need to ensure that the `diff` command is available by either installing [DiffUtils](http://gnuwin32.sourceforge.net/packages/diffutils.htm) or, if available, adding the Git `/usr/bin/` subdirectory to the Windows system `PATH`.
336+
> The `*nix` `diff` command is required for generating reports in `diff` format. Windows users may need to ensure that the `diff` command is available by either installing [DiffUtils](http://gnuwin32.sourceforge.net/packages/diffutils.htm) or, if available, adding the Git `/usr/bin/` sub-directory to the Windows system `PATH`.
337337
338338
<p align="right"><a href="#table-of-contents">back to top</a></p>
339339
340340
341341
## Printing an Emacs Report
342342
343-
PHP_CodeSniffer can output a report in a format the compiler built into the GNU Emacs text editor can understand. This lets you use the built-in complier to run PHP_CodeSniffer on a file you are editing and navigate between errors and warnings within the file. To print an Emacs report, use the `--report=emacs` command line argument. The output will look like this:
343+
PHP_CodeSniffer can output a report in a format the compiler built into the GNU Emacs text editor can understand. This lets you use the built-in compiler to run PHP_CodeSniffer on a file you are editing and navigate between errors and warnings within the file. To print an Emacs report, use the `--report=emacs` command line argument. The output will look like this:
344344
345345
```bash
346346
$ phpcs --report=emacs /path/to/code
@@ -368,7 +368,7 @@ Now you can use the compile command and associated shortcuts to move between err
368368
369369
## Printing a Git Blame Report
370370
371-
PHP_CodeSniffer can make use of the `git blame` command to try and determine who committed each error and warning to a Git respository. To print a Git Blame report, use the `--report=gitblame` command line argument. The output will look like this:
371+
PHP_CodeSniffer can make use of the `git blame` command to try and determine who committed each error and warning to a Git repository. To print a Git Blame report, use the `--report=gitblame` command line argument. The output will look like this:
372372
373373
```bash
374374
$ phpcs --report=gitblame /path/to/code
@@ -437,7 +437,7 @@ A TOTAL OF 165 SNIFF VIOLATION(S) WERE COMMITTED BY 5 AUTHOR(S)
437437
438438
## Printing a JSON Report
439439
440-
PHP_CodeSniffer can output an JSON report to allow you to parse the output and use the results in your own scripts. To print a JSON report, use the `--report=json` command line argument. The output will look like this:
440+
PHP_CodeSniffer can output a JSON report to allow you to parse the output and use the results in your own scripts. To print a JSON report, use the `--report=json` command line argument. The output will look like this:
441441
442442
```bash
443443
$ phpcs --report=json /path/to/code
@@ -556,7 +556,7 @@ PHP_CodeSniffer can output a sniff performance report showing you which sniffs i
556556
When the `--colors` option is enabled, sniffs which take more than twice the average run time per sniff will be displayed in orange and sniffs with a cumulative listener run time of more than three times the average run time per sniff will display in red.
557557
558558
> [!NOTE]
559-
> The Performance report will only be useful when run without using the cache as otherwise the cache functionality will interfer with accurately measuring the runtime of sniffs.
559+
> The Performance report will only be useful when run without using the cache as otherwise the cache functionality will interfere with accurately measuring the runtime of sniffs.
560560
> So make sure to always use the `--no-cache` feature when running Performance reports.
561561
562562
> [!NOTE]

wiki/Version-3.0-Upgrade-Guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public function generate(
292292

293293
### Supporting Concurrency
294294

295-
PHP_CodeSniffer version 3 supports processing multiple files concurrently, so reports can no longer rely on getting file results one at a time. Reports that used to write to local member vars can no longer do so as multiple forks of the PHP_CodeSniffer process will all be writing to a different instance of the report class at the same time and these cache values will never be merged. Instead, reports need to output their cached data directly. They will later be given a chance to read in the entire cached output and generate a final clean report.
295+
PHP_CodeSniffer version 3 supports processing multiple files concurrently, so reports can no longer rely on getting file results one at a time. Reports that used to write to local member variables can no longer do so as multiple forks of the PHP_CodeSniffer process will all be writing to a different instance of the report class at the same time and these cache values will never be merged. Instead, reports need to output their cached data directly. They will later be given a chance to read in the entire cached output and generate a final clean report.
296296

297297
> [!NOTE]
298298
> Reports that output content in a way where the order or formatting is not important do not need to worry about caching data and can continue to produce reports they way they do now. Examples of these reports include the CSV report and the XML report.

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ There is a separate [[Upgrade Guide for Ruleset Maintainers and End-Users|Versio
5252
It is highly recommended to upgrade external standards and integrations as soon as you are able.
5353

5454
Once PHP_CodeSniffer 4.0 has been released, the PHP_CodeSniffer 3.x branch will no longer receive updates, with the exception of security fixes and runtime compatibility fixes for new PHP versions.
55-
This "limited support" will last a maximum of one year from the date of the PHP_Codesniffer 4.0.0 release.
55+
This "limited support" will last a maximum of one year from the date of the PHP_CodeSniffer 4.0.0 release.
5656

5757
> [!IMPORTANT]
5858
> This also means that support for new PHP syntaxes will only land in PHP_CodeSniffer 4.x and will **NOT** be backported to the 3.x branch.
@@ -64,9 +64,9 @@ There are basically two upgrade strategies:
6464
1. Drop support for PHP_CodeSniffer 3.x completely and adopt support for PHP_CodeSniffer 4.x.
6565
2. Make your package cross-version compatible with both PHP_CodeSniffer 3.x as well as 4.x.
6666

67-
Which strategy is best suited for your project will depend on your userbase.
67+
Which strategy is best suited for your project will depend on your user-base.
6868

69-
If your userbase is known to often combine multiple external standards, making the package PHPCS cross-version compatible may be preferred to allow users to upgrade as soon as possible, while still benefitting from updates to your package if they can't upgrade to PHPCS 4.x yet.
69+
If your user-base is known to often combine multiple external standards, making the package PHPCS cross-version compatible may be preferred to allow users to upgrade as soon as possible, while still benefiting from updates to your package if they can't upgrade to PHPCS 4.x yet.
7070

7171
The vast majority of the below upgrade tasks will need to be executed in both cases, but there are some upgrade tasks which can only be executed once support for PHP_CodeSniffer 3.x is being dropped.
7272

@@ -150,10 +150,10 @@ Type casting for sniff property values set from within a ruleset has been made m
150150

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

153-
* If the sniff has work-arounds in place to handle non-lowercase string `'true'` or `'false'` values for boolean properties, those work-arounds can be removed.
154-
* If the sniff has work-arounds in place to handle (any case) string `'null'` values, those work-arounds can be removed.
153+
* If the sniff has workarounds in place to handle non-lowercase string `'true'` or `'false'` values for boolean properties, those workarounds can be removed.
154+
* If the sniff has workarounds in place to handle (any case) string `'null'` values, those workarounds can be removed.
155155
* If the sniff explicitly expects only string values for array elements, the sniff may need to be updated.
156-
* If the sniff has work-arounds in place to handle the type casting of `true`, `false` and/or `null` for array elements, those work-arounds can be removed.
156+
* If the sniff has workarounds in place to handle the type casting of `true`, `false` and/or `null` for array elements, those workarounds can be removed.
157157

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

@@ -228,8 +228,8 @@ Typically, this may impact projects which call `new Config` consecutive times pr
228228

229229
##### Upgrading
230230

231-
Typical work-arounds for the old behaviour will use `Reflection` to reset the `Config::$overriddenDefaults` property between instantiations.
232-
These type of work-arounds can now be removed.
231+
Typical workarounds for the old behaviour will use `Reflection` to reset the `Config::$overriddenDefaults` property between instantiations.
232+
These type of workarounds can now be removed.
233233

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

@@ -304,7 +304,7 @@ The following tokens have been removed:
304304

305305
If these tokens are used in PHP-only sniffs, they can be safely removed.
306306
If these tokens are used in JS/CSS only sniffs, as mentioned in ["Support for JS/CSS has been removed"](#support-for-jscss-has-been-removed): deprecate or remove the sniff.
307-
If these tokens are used in mixed sniffs, which also scan PHP files, remove the CSS/JS specific code or, for cross-version compatibility, check for the existance of the tokens before using them.
307+
If these tokens are used in mixed sniffs, which also scan PHP files, remove the CSS/JS specific code or, for cross-version compatibility, check for the existence of the tokens before using them.
308308

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

@@ -366,7 +366,7 @@ This re-tokenization has now been removed.
366366

367367
##### Upgrading
368368

369-
* Search your sniffs/code for `T_INSTANCEOF` and `'static'` to find any potential work-arounds in place for the old tokenization. Those can now be removed.
369+
* Search your sniffs/code for `T_INSTANCEOF` and `'static'` to find any potential workarounds in place for the old tokenization. Those can now be removed.
370370

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

@@ -563,9 +563,9 @@ The Ruleset class now respects sniff selection via `--sniffs=...`, even when in
563563

564564
#### Upgrading
565565

566-
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.
566+
If your own test framework contained workarounds to get round the previous restriction, it should now be safe to remove those workarounds and to use the `--sniffs=...` argument when initiating the `Config` class.
567567

568-
Typically, these type of work-around can be found by searching for calls to the `Ruleset::registerSniffs()` method.
568+
Typically, these type of workarounds can be found by searching for calls to the `Ruleset::registerSniffs()` method.
569569

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

0 commit comments

Comments
 (0)