Skip to content

Commit

Permalink
Merge pull request #2283 from WordPress/feature/alternativefunctions-…
Browse files Browse the repository at this point in the history
…minor-tweaks
  • Loading branch information
GaryJones authored Jul 4, 2023
2 parents b42708d + 83eba3a commit ae668d5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions WordPress/Sniffs/WP/AlternativeFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,24 +345,24 @@ public function process_matched_token( $stackPtr, $group_name, $matched_content
}

/**
* Determine based on the "raw" parameter value, whether a file parameter points to
* Determine based on the "clean" parameter value, whether a file parameter points to
* a local data stream.
*
* @param string $raw_param_value Raw parameter value.
* @param string $clean_param_value Parameter value without comments.
*
* @return bool True if this is a local data stream. False otherwise.
*/
protected function is_local_data_stream( $raw_param_value ) {
protected function is_local_data_stream( $clean_param_value ) {

$raw_stripped = TextStrings::stripQuotes( $raw_param_value );
if ( isset( $this->allowed_local_streams[ $raw_stripped ] )
|| isset( $this->allowed_local_stream_constants[ $raw_param_value ] )
$stripped = TextStrings::stripQuotes( $clean_param_value );
if ( isset( $this->allowed_local_streams[ $stripped ] )
|| isset( $this->allowed_local_stream_constants[ $clean_param_value ] )
) {
return true;
}

foreach ( $this->allowed_local_stream_partials as $partial ) {
if ( strpos( $raw_stripped, $partial ) === 0 ) {
if ( strpos( $stripped, $partial ) === 0 ) {
return true;
}
}
Expand Down

0 comments on commit ae668d5

Please sign in to comment.