Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

getEndTokenId does not handle string-dollar "${var}" interpolation #78

Merged
merged 1 commit into from
Oct 30, 2018
Merged

Conversation

StephenClouse
Copy link
Contributor

There is a bug in the PHP_TokenWithScope::getEndTokenId function that manifests as coverage issues in PHPUnit.

The opening token of the string-dollar style variable interpolation "${var}" (PHP_Token_DOLLAR_OPEN_CURLY_BRACES) is not recognized by the function when determining block depth. This causes an off-by-one error and results in the next-to-last close brace being seen as the end line of the function. This cascades into php-code-coverage/PHPUnit as the end of the function being treated as ignored/non-executable.

@codecov
Copy link

codecov bot commented Oct 30, 2018

Codecov Report

Merging #78 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #78      +/-   ##
============================================
+ Coverage     77.29%   77.34%   +0.04%     
- Complexity      210      211       +1     
============================================
  Files             3        3              
  Lines           511      512       +1     
============================================
+ Hits            395      396       +1     
  Misses          116      116
Impacted Files Coverage Δ Complexity Δ
src/Token.php 89.29% <100%> (+0.03%) 131 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 711ca0c...f381536. Read the comment docs.

@sebastianbergmann sebastianbergmann merged commit 2db135c into sebastianbergmann:master Oct 30, 2018
@sebastianbergmann
Copy link
Owner

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants