Skip to content

Commit c6673f5

Browse files
committed
Wiki: various grammar and spelling fixes
1 parent a39f821 commit c6673f5

9 files changed

+35
-35
lines changed

wiki/About-Standards-for-PHP_CodeSniffer.md

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

31-
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.
31+
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.
3232

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

36-
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.
36+
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.
3737

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

@@ -245,7 +245,7 @@ use PHP_CodeSniffer\Sniffs\Sniff;
245245
class OperatorSpacingSniff implements Sniff {...}
246246
```
247247

248-
:x: Not following the required directory structure (missing `[CategoryName]` subdirectory):
248+
:x: Not following the required directory structure (missing `[CategoryName]` sub-directory):
249249
```php
250250
<?php
251251
// File: MyStandard/Sniffs/OperatorSpacingSniff.php

wiki/Advanced-Usage.md

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

243243
## Using a Bootstrap File
244244

245-
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.
245+
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.
246246

247247
```bash
248-
$ phpcs --bootstrap=/path/to/boostrap.1.inc,/path/to/bootstrap.2.inc /path/to/code
248+
$ phpcs --bootstrap=/path/to/bootstrap.1.inc,/path/to/bootstrap.2.inc /path/to/code
249249
```
250250

251251
<p align="right"><a href="#table-of-contents">back to top</a></p>
@@ -334,13 +334,13 @@ Array
334334
<p align="right"><a href="#table-of-contents">back to top</a></p>
335335

336336

337-
## Printing Verbose Tokeniser Output
337+
## Printing Verbose Tokenizer Output
338338

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

341-
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.
341+
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.
342342

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

345345
### The Scope Map
346346

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

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

442-
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.
442+
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.
443443

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

wiki/Coding-Standard-Tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ final class DisallowHashCommentsSniff implements Sniff
128128
}
129129
```
130130

131-
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:
131+
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:
132132

133133
```php
134134
/**

wiki/Configuration-Options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ $ phpcs --config-set ignore_warnings_on_exit 1
218218
219219
## Ignoring non-auto-fixable issues when generating the exit code (PHP_CodeSniffer >= 4.0.0)
220220
221-
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.
222-
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.
221+
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.
222+
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.
223223
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.
224224
225225
```bash

wiki/Customisable-Sniff-Properties.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This sniff ensures that parameters passed to a function are used within that fun
4141
```php
4242
public function execute(InputInterface $input, OutputInterface $output): int
4343
{
44-
$output->writeln('Hello World!');
44+
$output->writeLine('Hello World!');
4545
}
4646
```
4747

@@ -911,7 +911,7 @@ $rootNode
911911
->end()
912912
->end();
913913
```
914-
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.
914+
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.
915915

916916
```xml
917917
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent">

wiki/Reporting.md

Lines changed: 4 additions & 4 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
@@ -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
@@ -280,7 +280,7 @@ public function generate(
280280

281281
### Supporting Concurrency
282282

283-
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.
283+
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.
284284

285285
> [!NOTE]
286286
> 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
@@ -24,7 +24,7 @@ There is a separate [[Upgrade Guide for Ruleset Maintainers and End-Users|Versio
2424
It is highly recommended to upgrade external standards and integrations as soon as you are able.
2525

2626
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.
27-
This "limited support" will last a maximum of one year from the date of the PHP_Codesniffer 4.0.0 release.
27+
This "limited support" will last a maximum of one year from the date of the PHP_CodeSniffer 4.0.0 release.
2828

2929
> [!IMPORTANT]
3030
> 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.
@@ -36,9 +36,9 @@ There are basically two upgrade strategies:
3636
1. Drop support for PHP_CodeSniffer 3.x completely and adopt support for PHP_CodeSniffer 4.x.
3737
2. Make your package cross-version compatible with both PHP_CodeSniffer 3.x as well as 4.x.
3838

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

41-
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.
41+
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.
4242

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

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

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

125-
* 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.
126-
* If the sniff has work-arounds in place to handle (any case) string `'null'` values, those work-arounds can be removed.
125+
* If the sniff has workarounds in place to handle non-lowercase string `'true'` or `'false'` values for boolean properties, those workarounds can be removed.
126+
* If the sniff has workarounds in place to handle (any case) string `'null'` values, those workarounds can be removed.
127127
* If the sniff explicitly expects only string values for array elements, the sniff may need to be updated.
128-
* 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.
128+
* 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.
129129

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

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

201201
##### Upgrading
202202

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

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

@@ -276,7 +276,7 @@ The following tokens have been removed:
276276

277277
If these tokens are used in PHP-only sniffs, they can be safely removed.
278278
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.
279-
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.
279+
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.
280280

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

@@ -338,7 +338,7 @@ This re-tokenization has now been removed.
338338

339339
##### Upgrading
340340

341-
* 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.
341+
* 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.
342342

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

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

536536
**Upgrading**
537537

538-
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.
538+
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.
539539

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

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

0 commit comments

Comments
 (0)