Skip to content

Commit 1784eb4

Browse files
committed
Various documentation fixes
... collected along the way.
1 parent ab6caa0 commit 1784eb4

File tree

9 files changed

+30
-30
lines changed

9 files changed

+30
-30
lines changed

src/Files/File.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ public function getMethodParameters($stackPtr)
13701370
case T_SELF:
13711371
case T_PARENT:
13721372
case T_STATIC:
1373-
// Self is valid, the others invalid, but were probably intended as type hints.
1373+
// Self and parent are valid, static invalid, but was probably intended as type hint.
13741374
if (isset($defaultStart) === false) {
13751375
if ($typeHintToken === false) {
13761376
$typeHintToken = $i;
@@ -1945,10 +1945,10 @@ public function isReference($stackPtr)
19451945
* Returns the content of the tokens from the specified start position in
19461946
* the token stack for the specified length.
19471947
*
1948-
* @param int $start The position to start from in the token stack.
1949-
* @param int $length The length of tokens to traverse from the start pos.
1950-
* @param int $origContent Whether the original content or the tab replaced
1951-
* content should be used.
1948+
* @param int $start The position to start from in the token stack.
1949+
* @param int $length The length of tokens to traverse from the start pos.
1950+
* @param bool $origContent Whether the original content or the tab replaced
1951+
* content should be used.
19521952
*
19531953
* @return string The token contents.
19541954
*/

src/Sniffs/AbstractScopeSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* parent::__construct(array(T_CLASS), array(T_FUNCTION));
1212
* }
1313
*
14-
* protected function processTokenWithinScope(\PHP_CodeSniffer\Files\File $phpcsFile, $)
14+
* protected function processTokenWithinScope(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr, $currScope)
1515
* {
1616
* $className = $phpcsFile->getDeclarationName($currScope);
1717
* echo 'encountered a method within class '.$className;
@@ -123,7 +123,7 @@ final public function register()
123123
*
124124
* @return void|int Optionally returns a stack pointer. The sniff will not be
125125
* called again on the current file until the returned stack
126-
* pointer is reached. Return (count($tokens) + 1) to skip
126+
* pointer is reached. Return ($phpcsFile->numTokens + 1) to skip
127127
* the rest of the file.
128128
* @see processTokenWithinScope()
129129
*/
@@ -166,7 +166,7 @@ final public function process(File $phpcsFile, $stackPtr)
166166
*
167167
* @return void|int Optionally returns a stack pointer. The sniff will not be
168168
* called again on the current file until the returned stack
169-
* pointer is reached. Return (count($tokens) + 1) to skip
169+
* pointer is reached. Return ($phpcsFile->numTokens + 1) to skip
170170
* the rest of the file.
171171
*/
172172
abstract protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope);

src/Sniffs/AbstractVariableSniff.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function __construct()
7373
*
7474
* @return void|int Optionally returns a stack pointer. The sniff will not be
7575
* called again on the current file until the returned stack
76-
* pointer is reached. Return (count($tokens) + 1) to skip
76+
* pointer is reached. Return ($phpcsFile->numTokens + 1) to skip
7777
* the rest of the file.
7878
*/
7979
final protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope)
@@ -157,7 +157,7 @@ final protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $cu
157157
*
158158
* @return void|int Optionally returns a stack pointer. The sniff will not be
159159
* called again on the current file until the returned stack
160-
* pointer is reached. Return (count($tokens) + 1) to skip
160+
* pointer is reached. Return ($phpcsFile->numTokens + 1) to skip
161161
* the rest of the file.
162162
*/
163163
final protected function processTokenOutsideScope(File $phpcsFile, $stackPtr)
@@ -188,7 +188,7 @@ final protected function processTokenOutsideScope(File $phpcsFile, $stackPtr)
188188
*
189189
* @return void|int Optionally returns a stack pointer. The sniff will not be
190190
* called again on the current file until the returned stack
191-
* pointer is reached. Return (count($tokens) + 1) to skip
191+
* pointer is reached. Return ($phpcsFile->numTokens + 1) to skip
192192
* the rest of the file.
193193
*/
194194
abstract protected function processMemberVar(File $phpcsFile, $stackPtr);
@@ -203,7 +203,7 @@ abstract protected function processMemberVar(File $phpcsFile, $stackPtr);
203203
*
204204
* @return void|int Optionally returns a stack pointer. The sniff will not be
205205
* called again on the current file until the returned stack
206-
* pointer is reached. Return (count($tokens) + 1) to skip
206+
* pointer is reached. Return ($phpcsFile->numTokens + 1) to skip
207207
* the rest of the file.
208208
*/
209209
abstract protected function processVariable(File $phpcsFile, $stackPtr);
@@ -222,7 +222,7 @@ abstract protected function processVariable(File $phpcsFile, $stackPtr);
222222
*
223223
* @return void|int Optionally returns a stack pointer. The sniff will not be
224224
* called again on the current file until the returned stack
225-
* pointer is reached. Return (count($tokens) + 1) to skip
225+
* pointer is reached. Return ($phpcsFile->numTokens + 1) to skip
226226
* the rest of the file.
227227
*/
228228
abstract protected function processVariableInString(File $phpcsFile, $stackPtr);

src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ do {
2525

2626
while ( $sample === false ) {}
2727

28-
// Silly, but not an assignment.
28+
// Silly, but not an assignment.
2929
if (123 = $a) {}
3030
if (strtolower($b) = $b) {}
3131
if (array( 1 => 'a', 2 => 'b' ) = $b) {}

src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class FunctionSpacingSniff implements Sniff
3838
public $spacingAfterLast = 2;
3939

4040
/**
41-
* The number of blank lines after the last function in a class.
41+
* Original properties as set in a custom ruleset (if any).
4242
*
43-
* @var integer
43+
* @var array
4444
*/
4545
private $rulesetProperties = null;
4646

src/Tokenizers/PHP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ protected function tokenize($string)
781781
&& $tokens[($stackPtr + 2)][0] === T_STRING
782782
&& strtolower($tokens[($stackPtr + 2)][1]) === 'from'
783783
) {
784-
// Could be multi-line, so just just the token stack.
784+
// Could be multi-line, so just the token stack.
785785
$token[0] = T_YIELD_FROM;
786786
$token[1] = $token[1].$tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1];
787787

src/Tokenizers/Tokenizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct($content, $config, $eolChar='\n')
8787
/**
8888
* Checks the content to see if it looks minified.
8989
*
90-
* @param string $content The content to tokenize,
90+
* @param string $content The content to tokenize.
9191
* @param string $eolChar The EOL char used in the content.
9292
*
9393
* @return boolean
@@ -1372,7 +1372,7 @@ private function recurseScopeMap($stackPtr, $depth=1, &$ignore=0)
13721372
*
13731373
* The level map adds a 'level' index to each token which indicates the
13741374
* depth that a token within a set of scope blocks. It also adds a
1375-
* 'condition' index which is an array of the scope conditions that opened
1375+
* 'conditions' index which is an array of the scope conditions that opened
13761376
* each of the scopes - position 0 being the first scope opener.
13771377
*
13781378
* @return void

src/Util/Tokens.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ final class Tokens
145145
T_FUNCTION => 100,
146146
T_CLOSURE => 100,
147147

148-
/*
149-
Conditions.
150-
*/
148+
/*
149+
* Conditions.
150+
*/
151151

152152
T_WHILE => 50,
153153
T_FOR => 50,
@@ -164,9 +164,9 @@ final class Tokens
164164
T_SELF => 25,
165165
T_PARENT => 25,
166166

167-
/*
168-
Operators and arithmetic.
169-
*/
167+
/*
168+
* Operators and arithmetic.
169+
*/
170170

171171
T_BITWISE_AND => 8,
172172
T_BITWISE_OR => 8,
@@ -201,9 +201,9 @@ final class Tokens
201201
T_BOOLEAN_AND => 5,
202202
T_BOOLEAN_OR => 5,
203203

204-
/*
205-
Equality.
206-
*/
204+
/*
205+
* Equality.
206+
*/
207207

208208
T_IS_EQUAL => 5,
209209
T_IS_NOT_EQUAL => 5,
@@ -566,7 +566,7 @@ final class Tokens
566566
];
567567

568568
/**
569-
* Tokens that are open class and object scopes.
569+
* Tokens that open class and object scopes.
570570
*
571571
* @var array<int, int>
572572
*/

tests/Core/File/FindEndOfStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function testHeredocFunctionArg()
145145
*/
146146
public function testSwitch()
147147
{
148-
// Find the end of the swtich.
148+
// Find the end of the switch.
149149
$start = ($this->phpcsFile->findNext(T_COMMENT, 0, null, false, '/* testSwitch */') + 2);
150150
$found = $this->phpcsFile->findEndOfStatement($start);
151151

0 commit comments

Comments
 (0)