Skip to content

Commit 98e8146

Browse files
authored
Merge pull request #961 from PHPCSStandards/feature/various-minor-docs-fixes
Docs: various minor fixes
2 parents 71fcf9a + e974de8 commit 98e8146

File tree

11 files changed

+15
-18
lines changed

11 files changed

+15
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ Additionally, thanks to [Alexander Turek][@derrabus] for consulting on the repo
22682268
- Thanks to [Juliette Reinders Folmer][@jrfnl] for the help with this patch
22692269
- Array properties set inside a ruleset.xml file can now extend a previous value instead of always overwriting it
22702270
- e.g., if you include a ruleset that defines forbidden functions, can you now add to that list instead of having to redefine it
2271-
- To use this feature, add extends="true" to the property tag
2271+
- To use this feature, add extend="true" to the property tag
22722272
- e.g., property name="forbiddenFunctionNames" type="array" extend="true"
22732273
- Thanks to [Michael Moravec][@Majkl578] for the patch
22742274
- If $XDG_CACHE_HOME is set and points to a valid directory, it will be used for caching instead of the system temp directory

src/Sniffs/AbstractScopeSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* protected function processTokenWithinScope(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr, $currScope)
1515
* {
1616
* $className = $phpcsFile->getDeclarationName($currScope);
17-
* echo 'encountered a method within class '.$className;
17+
* $phpcsFile->addWarning('encountered a method within class '.$className, $stackPtr, 'MethodFound');
1818
* }
1919
* }
2020
* </code>

src/Tokenizers/Comment.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ class Comment
1616

1717

1818
/**
19-
* Creates an array of tokens when given some PHP code.
19+
* Splits a single doc block comment token up into something that can be easily iterated over.
2020
*
21-
* Starts by using token_get_all() but does a lot of extra processing
22-
* to insert information about the context of the token.
23-
*
24-
* @param string $string The string to tokenize.
21+
* @param string $string The doc block comment string to parse.
2522
* @param string $eolChar The EOL character to use for splitting strings.
26-
* @param int $stackPtr The position of the first token in the file.
23+
* @param int $stackPtr The position of the token in the "new"/final token stream.
2724
*
2825
* @return array<int, array<string, string|int|array<int>>>
2926
*/

src/Tokenizers/PHP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2298,7 +2298,7 @@ function return types. We want to keep the parenthesis map clean,
22982298
) {
22992299
// Non-empty content.
23002300
if (is_array($tokens[$x]) === true && $tokens[$x][0] === T_USE) {
2301-
// Found a use statements, so search ahead for the closing parenthesis.
2301+
// Found a use statement, so search ahead for the closing parenthesis.
23022302
for ($x += 1; $x < $numTokens; $x++) {
23032303
if (is_array($tokens[$x]) === false && $tokens[$x] === ')') {
23042304
continue(2);

src/Tokenizers/Tokenizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ abstract class Tokenizer
7676
/**
7777
* Initialise and run the tokenizer.
7878
*
79-
* @param string $content The content to tokenize.
80-
* @param \PHP_CodeSniffer\Config | null $config The config data for the run.
81-
* @param string $eolChar The EOL char used in the content.
79+
* @param string $content The content to tokenize.
80+
* @param \PHP_CodeSniffer\Config|null $config The config data for the run.
81+
* @param string $eolChar The EOL char used in the content.
8282
*
8383
* @return void
8484
* @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified.

tests/ConfigDouble.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class ConfigDouble extends Config
4141
* the ruleset auto-discovery.
4242
* Note: there is no need to set this to `true` when a standard
4343
* is being passed via the `$cliArgs`. Those settings will always
44-
* respected.
44+
* be respected.
4545
* Defaults to `false`. Will result in the standard being set
4646
* to "PSR1" if not provided via `$cliArgs`.
4747
* @param bool $skipSettingReportWidth Whether to skip setting a report-width to prevent

tests/Core/File/GetMethodPropertiesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public function testReturnNamespace()
356356

357357

358358
/**
359-
* Test a method with a messy namespaces return type.
359+
* Test a method with a messy namespaced return type.
360360
*
361361
* @return void
362362
*/

tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/PropertyTypeHandlingSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Test fixture.
44
*
5-
* @see \PHP_CodeSniffer\Tests\Core\Ruleset\SetSniffPropertyTest
5+
* @see \PHP_CodeSniffer\Tests\Core\Ruleset\PropertyTypeHandlingTest
66
*/
77

88
namespace Fixtures\TestStandard\Sniffs\SetProperty;

tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function initializeConfigAndRuleset()
8888

8989

9090
/**
91-
* Destroy the Config object and restor the ini values after the tests.
91+
* Destroy the Config object and restore the ini values after the tests.
9292
*
9393
* @afterClass
9494
*

tests/Core/Tokenizers/PHP/AttributesTest.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function multiple_attributes_on_parameter_test(#[ParamAttribute, AttributeWithPa
6262

6363
/* testFqcnAttribute */
6464
#[Boo\QualifiedName, \Foo\FullyQualifiedName('foo')]
65-
function fqcn_attrebute_test() {}
65+
function fqcn_attribute_test() {}
6666

6767
/* testNestedAttributes */
6868
#[Boo\QualifiedName(fn (#[AttributeOne('boo')] $value) => (string) $value)]

0 commit comments

Comments
 (0)