Skip to content

Commit dfa99fd

Browse files
authored
Merge pull request #632 from Automattic/fix/various-minor-documentation-fixes
Documentation: various minor improvements
2 parents d199359 + d66899c commit dfa99fd

File tree

11 files changed

+30
-34
lines changed

11 files changed

+30
-34
lines changed

WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public function findNonCheckedVariables( $stackPtr ) {
291291
* Function used as as callback for the array_reduce call.
292292
*
293293
* @param string $carry The final string.
294-
* @param array $item Processed item.
294+
* @param array $item Processed item.
295295
*
296296
* @return string
297297
*/

WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public function is_targetted_token( $stackPtr ) {
396396
if ( isset( $skipped[ $this->tokens[ $prev ]['code'] ] ) ) {
397397
return false;
398398
}
399-
// Skip namespaced functions, ie: \foo\bar() not \bar().
399+
// Skip namespaced functions, ie: `\foo\bar()` not `\bar()`.
400400
if ( $this->tokens[ $prev ]['code'] === \T_NS_SEPARATOR ) {
401401
$pprev = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, $prev - 1, null, true );
402402
if ( $pprev !== false && $this->tokens[ $pprev ]['code'] === \T_STRING ) {

WordPressVIPMinimum/Sniffs/Hooks/AlwaysReturnInFilterSniff.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ private function processArray( $stackPtr ) {
122122
* Process string.
123123
*
124124
* @param int $stackPtr The position in the stack where the token was found.
125-
* @param int $start The start of the token.
126-
* @param int $end The end of the token.
125+
* @param int $start The start of the token.
126+
* @param int $end The end of the token.
127127
*/
128128
private function processString( $stackPtr, $start = 0, $end = null ) {
129129

@@ -149,8 +149,8 @@ private function processString( $stackPtr, $start = 0, $end = null ) {
149149
* Process function.
150150
*
151151
* @param int $stackPtr The position in the stack where the token was found.
152-
* @param int $start The start of the token.
153-
* @param int $end The end of the token.
152+
* @param int $start The start of the token.
153+
* @param int $end The end of the token.
154154
*/
155155
private function processFunction( $stackPtr, $start = 0, $end = null ) {
156156

WordPressVIPMinimum/Sniffs/Hooks/PreGetPostsSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function processClosure( $stackPtr ) {
195195
/**
196196
* Process function's body
197197
*
198-
* @param int $stackPtr The position in the stack where the token was found.
198+
* @param int $stackPtr The position in the stack where the token was found.
199199
* @param string $variableName Variable name.
200200
*/
201201
private function processFunctionBody( $stackPtr, $variableName ) {
@@ -363,7 +363,7 @@ private function isEarlyMainQueryCheck( $stackPtr ) {
363363
* Is the current code a WP_Query call?
364364
*
365365
* @param int $stackPtr The position in the stack where the token was found.
366-
* @param null $method Method.
366+
* @param null $method Method.
367367
*
368368
* @return bool
369369
*/

WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public function process_token( $stackPtr ) {
6565
/**
6666
* Consolidated violation.
6767
*
68-
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
69-
* @param array $data Replacements for the error message.
68+
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
69+
* @param array $data Replacements for the error message.
7070
*/
7171
private function addFoundError( $stackPtr, array $data ) {
7272
$message = 'HTML string concatenation detected, this is a security risk, use DOM node construction or a templating language instead: %s.';

WordPressVIPMinimum/Sniffs/Performance/RegexpCompareSniff.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ class RegexpCompareSniff extends AbstractArrayAssignmentRestrictionsSniff {
1818

1919
/**
2020
* Groups of variables to restrict.
21-
* This should be overridden in extending classes.
2221
*
2322
* Example: groups => array(
24-
* 'wpdb' => array(
25-
* 'type' => 'error' | 'warning',
26-
* 'message' => 'Dont use this one please!',
27-
* 'variables' => array( '$val', '$var' ),
28-
* 'object_vars' => array( '$foo->bar', .. ),
29-
* 'array_members' => array( '$foo['bar']', .. ),
30-
* )
23+
* 'groupname' => array(
24+
* 'type' => 'error' | 'warning',
25+
* 'message' => 'Dont use this one please!',
26+
* 'keys' => array( 'key1', 'another_key' ),
27+
* 'callback' => array( 'class', 'method' ), // Optional.
28+
* )
3129
* )
3230
*
3331
* @return array

WordPressVIPMinimum/Sniffs/Performance/RemoteRequestTimeoutSniff.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ class RemoteRequestTimeoutSniff extends AbstractArrayAssignmentRestrictionsSniff
1818

1919
/**
2020
* Groups of variables to restrict.
21-
* This should be overridden in extending classes.
2221
*
2322
* Example: groups => array(
24-
* 'wpdb' => array(
25-
* 'type' => 'error' | 'warning',
26-
* 'message' => 'Dont use this one please!',
27-
* 'variables' => array( '$val', '$var' ),
28-
* 'object_vars' => array( '$foo->bar', .. ),
29-
* 'array_members' => array( '$foo['bar']', .. ),
30-
* )
23+
* 'groupname' => array(
24+
* 'type' => 'error' | 'warning',
25+
* 'message' => 'Dont use this one please!',
26+
* 'keys' => array( 'key1', 'another_key' ),
27+
* 'callback' => array( 'class', 'method' ), // Optional.
28+
* )
3129
* )
3230
*
3331
* @return array

WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function is_html_attr( $content ) {
146146
* A helper function which tests whether string ends with some other.
147147
*
148148
* @param string $haystack String which is being tested.
149-
* @param string $needle The substring, which we try to locate on the end of the $haystack.
149+
* @param string $needle The substring, which we try to locate on the end of the $haystack.
150150
*
151151
* @return bool True if haystack ends with needle.
152152
*/

WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public function process_text_for_style( $stackPtr, $file_name ) {
319319
/**
320320
* Processes this test for T_STYLE tokens in CSS files.
321321
*
322-
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
322+
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
323323
*
324324
* @return void
325325
*/
@@ -370,7 +370,7 @@ protected function process_css_style( $stackPtr ) {
370370
/**
371371
* Consolidated violation.
372372
*
373-
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
373+
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
374374
*/
375375
private function addHidingDetectedError( $stackPtr ) {
376376
$message = 'Hiding of the admin bar is not allowed.';

WordPressVIPMinimum/Sniffs/Variables/VariableAnalysisSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use PHP_CodeSniffer\Files\File;
1818

1919
/**
20-
* Checks the for undefined function variables.
20+
* Checks for undefined function variables.
2121
*
2222
* This sniff checks that all function variables
2323
* are defined in the function body.

0 commit comments

Comments
 (0)