Skip to content

Commit 675e399

Browse files
authored
Merge pull request #145 from PHPCSStandards/feature/various-docs-fixes
Docs: various small fixes
2 parents 4da4916 + 5c38475 commit 675e399

File tree

10 files changed

+17
-18
lines changed

10 files changed

+17
-18
lines changed

PHPCSUtils/BackCompat/Helper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static function getTabWidth(File $phpcsFile)
172172
*
173173
* @since 1.0.0
174174
*
175-
* @param \PHP_CodeSniffer\Files\File $phpcsFile Optional. The current file being processed.
175+
* @param \PHP_CodeSniffer\Files\File|null $phpcsFile Optional. The current file being processed.
176176
*
177177
* @return string Encoding. Defaults to the PHPCS native default, which is 'utf-8'
178178
* for PHPCS 3.x and was 'iso-8859-1' for PHPCS 2.x.
@@ -213,8 +213,7 @@ public static function getEncoding(File $phpcsFile = null)
213213
*
214214
* @since 1.0.0
215215
*
216-
* @param \PHP_CodeSniffer\Files\File $phpcsFile Optional. The current file
217-
* being processed.
216+
* @param \PHP_CodeSniffer\Files\File|null $phpcsFile Optional. The current file being processed.
218217
*
219218
* @return bool True if annotations should be ignored, false otherwise.
220219
*/

PHPCSUtils/Tokens/Collections.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ class Collections
343343
* It is recommended to use the method instead of the property if a standard supports PHPCS < 3.3.0.
344344
*
345345
* @see \PHPCSUtils\Tokens\Collections::parameterTypeTokensBC() Related method (cross-version).
346-
346+
*
347347
* @since 1.0.0
348348
*
349349
* @var array <int|string> => <int|string>
@@ -406,7 +406,7 @@ class Collections
406406
* The method supports PHPCS 2.6.0 and up.
407407
*
408408
* Notable differences:
409-
* - The method will include the `T_ARRAY_HINT` and the `T_RETURN_TYPE tokens when used with PHPCS 2.x and 3.x.
409+
* - The method will include the `T_ARRAY_HINT` and the `T_RETURN_TYPE` tokens when used with PHPCS 2.x and 3.x.
410410
* These token constants will no longer exist in PHPCS 4.x.
411411
* - The method will include the `T_ARRAY` token which is needed for select arrow functions in PHPCS < 3.5.4.
412412
*
@@ -580,7 +580,7 @@ public static function functionDeclarationTokens()
580580
* It is recommended to use the method instead of the property if a standard supports PHPCS < 3.3.0.
581581
*
582582
* @see \PHPCSUtils\Tokens\Collections::functionDeclarationTokens() Related method (PHPCS 3.5.3+).
583-
* @see \PHPCSUtils\Tokens\FunctionDeclarations::isArrowFunction() Arrow function verification.
583+
* @see \PHPCSUtils\Utils\FunctionDeclarations::isArrowFunction() Arrow function verification.
584584
*
585585
* @since 1.0.0
586586
*
@@ -661,7 +661,7 @@ public static function propertyTypeTokensBC()
661661
* The method supports PHPCS 2.6.0 and up.
662662
*
663663
* Notable differences:
664-
* - The method will include the `T_ARRAY_HINT` and the `T_RETURN_TYPE tokens when used with PHPCS 2.x and 3.x.
664+
* - The method will include the `T_ARRAY_HINT` and the `T_RETURN_TYPE` tokens when used with PHPCS 2.x and 3.x.
665665
* These token constants will no longer exist in PHPCS 4.x.
666666
* - The method will include the `T_ARRAY` token which is needed for select arrow functions in PHPCS < 3.5.4.
667667
*

PHPCSUtils/Utils/Arrays.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ public static function getDoubleArrowPtr(File $phpcsFile, $start, $end)
288288

289289
/*
290290
* BC: work-around a bug in PHPCS 3.5.4 where the double arrow is incorrectly tokenized as T_STRING.
291+
*
291292
* @link https://github.com/squizlabs/PHP_CodeSniffer/issues/2865
292293
*/
293294
if ($tokens[$doubleArrow]['code'] === \T_STRING && $tokens[$doubleArrow]['content'] === '=>') {

PHPCSUtils/Utils/ControlStructures.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public static function isElseIf(File $phpcsFile, $stackPtr)
200200
* Get the scope opener and closer for a `declare` statement.
201201
*
202202
* A `declare` statement can be:
203-
* - applied to the rest of the file, like `declare(ticks=1);`;
203+
* - applied to the rest of the file, like `declare(ticks=1);`
204204
* - applied to a limited scope using curly braces;
205205
* - applied to a limited scope using the alternative control structure syntax.
206206
*
@@ -358,7 +358,7 @@ public static function getDeclareScopeOpenClose(File $phpcsFile, $stackPtr)
358358
* @return array
359359
*
360360
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of
361-
* type T_CATCH or doesn't exist or in case
361+
* type T_CATCH, doesn't exist or in case
362362
* of a parse error.
363363
*/
364364
public static function getCaughtExceptions(File $phpcsFile, $stackPtr)

PHPCSUtils/Utils/FunctionDeclarations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public static function getName(File $phpcsFile, $stackPtr)
201201
* @return array
202202
*
203203
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a T_FUNCTION
204-
* or T_CLOSURE token nor an arrow function.
204+
* or T_CLOSURE token, nor an arrow function.
205205
*/
206206
public static function getProperties(File $phpcsFile, $stackPtr)
207207
{
@@ -604,7 +604,7 @@ public static function getParameters(File $phpcsFile, $stackPtr)
604604
* T_STRING token as those are the only two
605605
* tokens which can be the arrow function keyword.
606606
*
607-
* @return bool TRUE is the token is the "fn" keyword for an arrow function. FALSE when not or
607+
* @return bool TRUE if the token is the "fn" keyword for an arrow function. FALSE when not or
608608
* in case of live coding/parse error.
609609
*/
610610
public static function isArrowFunction(File $phpcsFile, $stackPtr)

PHPCSUtils/Utils/Lists.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public static function getOpenClose(File $phpcsFile, $stackPtr, $isShortList = n
260260
* // second item in `list($a, , $b)`.
261261
* 'is_nested_list' => bool, // Whether this is a nested list.
262262
* 'variable' => string|false, // The base variable being assigned to or
263-
* // FALSE in case of a nested list or avariable variable.
263+
* // FALSE in case of a nested list or a variable variable.
264264
* // I.e. `$a` in `list($a['key'])`.
265265
* 'assignment_token' => int|false, // The start pointer for the assignment.
266266
* 'assignment_end_token' => int|false, // The end pointer for the assignment.
@@ -269,7 +269,6 @@ public static function getOpenClose(File $phpcsFile, $stackPtr, $isShortList = n
269269
* // FALSE when not a reference assignment.
270270
* </code>
271271
*
272-
*
273272
* Assignments with keys will have the following additional array indexes set:
274273
* <code>
275274
* 'key' => string, // The content of the key, cleaned of comments.

PHPCSUtils/Utils/Numbers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class Numbers
9595
`ixD';
9696

9797
/**
98-
* Regex to determine is a T_STRING following a T_[DL]NUMBER is part of a numeric literal sequence.
98+
* Regex to determine if a T_STRING following a T_[DL]NUMBER is part of a numeric literal sequence.
9999
*
100100
* PHP cross-version compat for PHP 7.4 numeric literals with underscore separators.
101101
*
@@ -144,7 +144,7 @@ class Numbers
144144
* Helper function to deal with numeric literals, potentially with underscore separators.
145145
*
146146
* PHP < 7.4 does not tokenize numeric literals containing underscores correctly.
147-
* As of PHPCS 3.5.3, PHPCS contains a back-fill, but this backfill was buggy in the initial
147+
* As of PHPCS 3.5.3, PHPCS contains a backfill, but this backfill was buggy in the initial
148148
* implementation. A fix for this broken backfill is included in PHPCS 3.5.4.
149149
*
150150
* Either way, this function provides a backfill for all PHPCS/PHP combinations where

PHPCSUtils/Utils/ObjectDeclarations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public static function getClassProperties(File $phpcsFile, $stackPtr)
219219
* Works for classes, anonymous classes and interfaces, though it is strongly recommended
220220
* to use the {@see \PHPCSUtils\Utils\ObjectDeclarations::findExtendedInterfaceNames()}
221221
* method to examine interfaces instead. Interfaces can extend multiple parent interfaces,
222-
* and that use case is not handled by this method.
222+
* and that use-case is not handled by this method.
223223
*
224224
* Main differences with the PHPCS version:
225225
* - Bugs fixed:

Tests/BackCompat/BCFile/FindEndOfStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* With documentation contributions from:
1717
* @author Phil Davis <[email protected]>
18-
18+
*
1919
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
2020
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
2121
*/

phpcsutils-autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class_alias('\PHP_CodeSniffer_Exception', '\PHP_CodeSniffer\Exceptions\Tokenizer
102102
/*
103103
* Alias the PHPUnit 4/5 TestCase class to its PHPUnit 6+ name.
104104
*
105-
* This allows the both the PHPCSUtils native unit tests as well as the
105+
* This allows both the PHPCSUtils native unit tests as well as the
106106
* `UtilityMethodTestCase` class to work cross-version with PHPUnit
107107
* below 6.x and above.
108108
*

0 commit comments

Comments
 (0)