Skip to content

Commit

Permalink
Merge pull request #596 from Automattic/remove_blacklisted_word
Browse files Browse the repository at this point in the history
Functions/DynamicCalls: Remove the word "blacklisted" and use "disallowed"
  • Loading branch information
rebeccahum authored Nov 23, 2020
2 parents 387d448 + b99c31d commit 0496ce9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DynamicCallsSniff extends Sniff {
*
* @var array
*/
private $function_names = [
private $disallowed_functions = [
'assert' => true,
'compact' => true,
'extract' => true,
Expand Down Expand Up @@ -141,7 +141,7 @@ private function collect_variables() {
*/
$current_var_value = $this->strip_quotes( $this->tokens[ $value_ptr ]['content'] );

if ( isset( $this->function_names[ $current_var_value ] ) === false ) {
if ( isset( $this->disallowed_functions[ $current_var_value ] ) === false ) {
// Text string is not one of the ones we're looking for.
return;
}
Expand All @@ -167,7 +167,7 @@ private function find_dynamic_calls() {

/*
* If variable is not found in our registry of variables, do nothing, as we cannot be
* sure that the function being called is one of the blacklisted ones.
* sure that the function being called is one of the disallowed ones.
*/
if ( ! isset( $this->variables_arr[ $this->tokens[ $this->stackPtr ]['content'] ] ) ) {
return;
Expand Down

0 comments on commit 0496ce9

Please sign in to comment.