Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP/AlternativeFunctionsSniff::is_local_data_stream(): update param name and docs #2283

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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