-
Notifications
You must be signed in to change notification settings - Fork 498
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
QA/PHP 8.0 | Don't use reserved keywords as param names #561
Merged
schlessera
merged 12 commits into
develop
from
feature/533-dont-use-reserved-keywords-as-param-names
Sep 23, 2021
Merged
QA/PHP 8.0 | Don't use reserved keywords as param names #561
schlessera
merged 12 commits into
develop
from
feature/533-dont-use-reserved-keywords-as-param-names
Sep 23, 2021
Conversation
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
…s as param names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `Jar::before_redirect_check()` function from `$return` to `$response` and updates all uses of the parameter in the function to match. Includes fixing the docblock, in which the parameter name already didn't match the previous parameter name.
…m names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `Requests::flatten()` function from `$array` to `$dictionary` and updates all uses of the parameter in the function to match.
… param names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `Cookie::domain_matches()` function from `$string` to `$domain` and updates all uses of the parameter in the function to match. Includes changing the name of the function local `$domain_string` variable to `$cookie_domain` and updating the inline comments for comprehensibility as they had become unclear with the new names in play.
While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `Cookie::parse()` function from `$string` to `$cookie_header` and updates all uses of the parameter in the function to match.
…ram names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `IdnaEncoder::encode()` function from `$string` to `$hostname` and updates all uses of the parameter in the function to match.
…param names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `IdnaEncoder::to_ascii()` function from `$string` to `$text` and updates all uses of the parameter in the function to match.
…param names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `IdnaEncoder::is_ascii()` function from `$string` to `$text` and updates all uses of the parameter in the function to match.
…param names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `IdnaEncoder::nameprep()` function from `$string` to `$text` and updates all uses of the parameter in the function to match.
…rved keywords as param names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `Iri::replace_invalid_with_pct_encoding()` function from `$string` to `$text` and updates all uses of the parameter in the function to match.
…erved keywords as param names While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `Iri::remove_iunreserved_percent_encoded()` function from `$match` to `$regex_match` and updates all uses of the parameter in the function to match.
While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). This changes the parameter name for the `Iri::to_uri()` function from `$string` to `$iri` and updates all uses of the parameter in the function to match.
While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+). While this use in the test bootstrap is not problematic, for consistency, it is changed as well.
schlessera
approved these changes
Sep 23, 2021
schlessera
deleted the
feature/533-dont-use-reserved-keywords-as-param-names
branch
September 23, 2021 10:00
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While using reserved keywords as parameter names is perfectly valid PHP, I would strongly recommend against it as this decreases the comprehensibility/readability of code when these parameter names are subsequently used in function calls using named parameters (PHP 8.0+).
Related to #533
QA/PHP 8.0 | Jar::before_redirect_check(): don't use reserved keywords as param names
This changes the parameter name for the
Jar::before_redirect_check()
function from$return
to$response
and updates all uses of the parameter in the function to match.Includes fixing the docblock, in which the parameter name already didn't match the previous parameter name.
QA/PHP 8.0 | Requests::flatten(): don't use reserved keywords as param names
This changes the parameter name for the
Requests::flatten()
function from$array
to$dictionary
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | Cookie::domain_matches(): don't use reserved keywords as param names
This changes the parameter name for the
Cookie::domain_matches()
function from$string
to$domain
and updates all uses of the parameter in the function to match.Includes changing the name of the function local
$domain_string
variable to$cookie_domain
and updating the inline comments for comprehensibility as they had become unclear with the new names in play.QA/PHP 8.0 | Cookie::parse(): don't use reserved keywords as param names
This changes the parameter name for the
Cookie::parse()
function from$string
to$cookie_header
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | IdnaEncoder::encode(): don't use reserved keywords as param names
This changes the parameter name for the
IdnaEncoder::encode()
function from$string
to$hostname
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | IdnaEncoder::to_ascii(): don't use reserved keywords as param names
This changes the parameter name for the
IdnaEncoder::to_ascii()
function from$string
to$text
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | IdnaEncoder::is_ascii(): don't use reserved keywords as param names
This changes the parameter name for the
IdnaEncoder::is_ascii()
function from$string
to$text
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | IdnaEncoder::nameprep(): don't use reserved keywords as param names
This changes the parameter name for the
IdnaEncoder::nameprep()
function from$string
to$text
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | Iri::replace_invalid_with_pct_encoding(): don't use reserved keywords as param names
This changes the parameter name for the
Iri::replace_invalid_with_pct_encoding()
function from$string
to$text
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | Iri::remove_iunreserved_percent_encoded(): don't use reserved keywords as param names
This changes the parameter name for the
Iri::remove_iunreserved_percent_encoded()
function from$match
to$regex_match
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | Iri::to_uri(): don't use reserved keywords as param names
This changes the parameter name for the
Iri::to_uri()
function from$string
to$iri
and updates all uses of the parameter in the function to match.QA/PHP 8.0 | Test bootstrap: don't use reserved keywords as param names
While this use in the test bootstrap is not problematic, for consistency, it is changed as well.