Generic/InlineControlStructure: improve code coverage #1144
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.
Description
This PR improves code coverage for the
Generic.ControlStructures.InlineControlStructure
sniff. It is the last PR in a series discussed in #482 (review). It includes commit 8 from #482 and expands it, adding more tests. Including a test suggested by @jrfnl related to commit 3 (InlineControlStructureUnitTest.11.inc
), which has been dropped.There is still one line that is not covered by tests. I plan to address it in a separate PR. I still want to check a bit more, but I believe #880 made this line unreachable, and thus it can be removed.
PHP_CodeSniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php
Line 120 in e1b9595
I'm targeting
4.x
instead ofmaster
as this PR builds on top of #880, which also target4.x
(see #880 (comment)).Suggested changelog entry
N/A
Related issues/external references
Initially suggested in #482.
Types of changes
PR checklist