-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Added T_THROW to NonExecutableCodeSniff #4
Closed
Closed
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
Merged. Thanks for the patch and the test. |
rhowardiv
referenced
this pull request
in rhowardiv/PHP_CodeSniffer
Jan 10, 2013
Upstream (Squiz) updates
anomiex
referenced
this pull request
in anomiex/PHP_CodeSniffer
Dec 1, 2023
…pear-support Drop support for releasing via PEAR
anomiex
referenced
this pull request
in anomiex/PHP_CodeSniffer
Dec 1, 2023
jrfnl
added a commit
to jrfnl/PHP_CodeSniffer
that referenced
this pull request
Jul 29, 2024
Follow up after squizlabs#4 and squizlabs#39 The alternative path referred to in the bin scripts and the test bootstrap was specific for running via a PEAR install. This should no longer be needed (nor will this work).
jrfnl
added a commit
to jrfnl/PHP_CodeSniffer
that referenced
this pull request
Nov 6, 2024
This adds another set of dedicated tests to safeguard how XML docs which don't follow the specification are handled. This initial set of tests for this documents the current behaviour [*]. This behaviour may not always be the desired behaviour, in which case, this will be fixed in follow-up commits. To get these tests up and running, the following fatal errors needed to be fixed: * Fatal error when a code comparison only contains a single code element: ``` Fatal error: Uncaught Error: Call to a member function getAttribute() on null in path/to/PHP_CodeSniffer/src/Generators/Markdown.php:253 Stack trace: #0 path/to/PHP_CodeSniffer/src/Generators/Markdown.php(139): PHP_CodeSniffer\Generators\Markdown->getFormattedCodeComparisonBlock(Object(DOMElement)) #1 path/to/PHP_CodeSniffer/src/Generators/Markdown.php(39): PHP_CodeSniffer\Generators\Markdown->processSniff(Object(DOMElement)) squizlabs#2 path/to/PHP_CodeSniffer/src/Runner.php(99): PHP_CodeSniffer\Generators\Markdown->generate() squizlabs#3 path/to/PHP_CodeSniffer/bin/phpcs(14): PHP_CodeSniffer\Runner->runPHPCS() squizlabs#4 {main} thrown in path/to/PHP_CodeSniffer/src/Generators/Markdown.php on line 253 ``` * Fatal error when a code element contains no textual content: ``` Fatal error: Uncaught Error: Call to a member function getAttribute() on null in path/to/PHP_CodeSniffer/src/Generators/Markdown.php:246 Stack trace: #0 path/to/PHP_CodeSniffer/src/Generators/Markdown.php(139): PHP_CodeSniffer\Generators\Markdown->getFormattedCodeComparisonBlock(Object(DOMElement)) #1 path/to/PHP_CodeSniffer/src/Generators/Markdown.php(39): PHP_CodeSniffer\Generators\Markdown->processSniff(Object(DOMElement)) squizlabs#2 path/to/PHP_CodeSniffer/src/Runner.php(99): PHP_CodeSniffer\Generators\Markdown->generate() squizlabs#3 path/to/PHP_CodeSniffer/bin/phpcs(14): PHP_CodeSniffer\Runner->runPHPCS() squizlabs#4 {main} thrown in path/to/PHP_CodeSniffer/src/Generators/Markdown.php on line 246 ``` Both of these fatals are fixed by adding defensive coding validating that there are (at least) two code blocks to the `getFormattedCodeComparisonBlock()` methods for all three generator classes.
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.
No description provided.