-
-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #524 from wesm87/479-tax-query-whitelisting-comment
Add whitelisting comment for tax query
- Loading branch information
Showing
4 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,23 +6,23 @@ | |
* @package PHP_CodeSniffer | ||
* @author Shady Sharaf <[email protected]> | ||
*/ | ||
class WordPress_Sniffs_Arrays_ArrayAssignmentRestrictionsSniff implements PHP_CodeSniffer_Sniff | ||
class WordPress_Sniffs_Arrays_ArrayAssignmentRestrictionsSniff extends WordPress_Sniff | ||
{ | ||
|
||
/** | ||
* Exclude groups | ||
* | ||
* Example: 'foo,bar' | ||
* | ||
* @var string Comma-delimited group list | ||
* | ||
* @var string Comma-delimited group list | ||
*/ | ||
public $exclude = ''; | ||
|
||
/** | ||
* Groups of variable data to check against. | ||
* Don't use this in extended classes, override getGroups() instead. | ||
* This is only used for Unit tests. | ||
* | ||
* | ||
* @var array | ||
*/ | ||
public static $groups = array(); | ||
|
@@ -132,7 +132,7 @@ public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) | |
|
||
|
||
foreach ( $groups as $groupName => $group ) { | ||
|
||
if ( in_array( $groupName, $exclude ) ) { | ||
continue; | ||
} | ||
|
@@ -165,9 +165,9 @@ public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) | |
|
||
call_user_func( | ||
$addWhat, | ||
$message, | ||
$stackPtr, | ||
$groupName, | ||
$message, | ||
$stackPtr, | ||
$groupName, | ||
array( $key, $val ) | ||
); | ||
} | ||
|
@@ -183,7 +183,7 @@ public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) | |
/** | ||
* Callback to process each confirmed key, to check value | ||
* This must be extended to add the logic to check assignment value | ||
* | ||
* | ||
* @param string $key Array index / key | ||
* @param mixed $val Assigned value | ||
* @param int $line Token line | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ public function getWarningList() | |
15 => 1, | ||
16 => 1, | ||
19 => 2, | ||
30 => 1, | ||
); | ||
|
||
}//end getWarningList() | ||
|