-
-
Notifications
You must be signed in to change notification settings - Fork 518
AbstractFunctionRestrictions sniffs: add tests for namespaced names #2581
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
Open
rodrigoprimo
wants to merge
12
commits into
WordPress:develop
Choose a base branch
from
rodrigoprimo:add-abstract-function-restrictions-tests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b0fd7f6
AbstractFunctionRestrictions: add tests for namespaced names
rodrigoprimo d11af77
DateTime/RestrictedFunctions: add tests for namespaced names
rodrigoprimo 6e9ba6e
DB/RestrictedFunctions: add tests for namespaced names
rodrigoprimo f1c01ec
PHP/DevelopmentFunctions: add tests for namespaced names
rodrigoprimo 3681bf7
PHP/DiscouragedPHPFunctions: add tests for namespaced names
rodrigoprimo 05e1e75
PHP/DontExtract: add tests for namespaced names
rodrigoprimo 14a1c59
PHP/POSIXFunctions: add tests for namespaced names
rodrigoprimo a6d7188
PHP/RestrictedPHPFunctions: add tests for namespaced names
rodrigoprimo 5599135
Security/SafeRedirect: add tests for namespaced names
rodrigoprimo 92de8be
WP/AlternativeFunctions: add tests for namespaced names
rodrigoprimo 8c98ad3
WP/DeprecatedFunctions: rename test case file
rodrigoprimo 30a147a
WP/DeprecatedFunctions: add tests for namespaced names
rodrigoprimo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -52,6 +52,7 @@ public function getWarningList() { | |
24 => 1, | ||
33 => 1, | ||
34 => 1, | ||
42 => 1, | ||
); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -60,6 +60,7 @@ public function getWarningList() { | |
37 => 1, | ||
38 => 1, | ||
39 => 1, | ||
48 => 1, | ||
); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -35,6 +35,7 @@ public function getErrorList() { | |
22 => 1, | ||
24 => 1, | ||
26 => 1, | ||
31 => 1, | ||
); | ||
} | ||
|
||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -37,6 +37,7 @@ public function getErrorList() { | |
public function getWarningList() { | ||
return array( | ||
3 => 1, | ||
9 => 1, | ||
); | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -147,3 +147,11 @@ file_get_contents( | |
// Not using plugin_dir_path() for reasons. | ||
$url | ||
); // Warning. | ||
|
||
/* | ||
* Safeguard support for PHP 8.0+ tokenization of namespaced "names". | ||
*/ | ||
\curl_init(); | ||
MyNamespace\curl_init(); | ||
\MyNamespace\curl_init(); | ||
namespace\curl_init(); // The sniff should start flagging this once it can resolve relative namespaces. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests need to be expanded a lot more. This sniff also looks at the parameters for a number of target functions and for those check for certain (global) constants and/or function calls in the parameters, so tests are needed to cover those being fully qualified as well. |
This file contains hidden or 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 |
---|---|---|
|
@@ -89,6 +89,7 @@ public function getWarningList() { | |
131 => 1, | ||
142 => 1, | ||
146 => 1, | ||
154 => 1, | ||
); | ||
} | ||
} |
File renamed without changes.
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* Safeguard support for PHP 8.0+ tokenization of namespaced "names". | ||
*/ | ||
\the_category_ID(); | ||
MyNamespace\the_category_ID(); | ||
\MyNamespace\the_category_ID(); | ||
namespace\the_category_ID(); // The sniff should start flagging this once it can resolve relative namespaces. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these tests have re-used the currently empty block of lines at the top of the file ?