Skip to content

Conversation

@julianschwuchow
Copy link

@julianschwuchow julianschwuchow commented Jan 25, 2019

Closes #350

$declarationNode =
ParserHelpers\tryGetPropertyDeclaration($expr) ??
ParserHelpers\tryGetConstOrClassConstDeclaration($expr);
$declarationNode = $declarationNode ?? $expr;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The double assignments reads very weird - just chain the ?? together

$declarationNode =
    ParserHelpers\tryGetPropertyDeclaration($expr) ??
    ParserHelpers\tryGetConstOrClassConstDeclaration($expr) ??
    $expr;

Copy link
Owner

@felixfbecker felixfbecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

@felixfbecker
Copy link
Owner

Could you add a unit test for this? Otherwise it's prone to break through future changes

@codecov
Copy link

codecov bot commented Jan 25, 2019

Codecov Report

Merging #701 into master will increase coverage by 0.01%.
The diff coverage is 85.71%.

@@             Coverage Diff              @@
##             master     #701      +/-   ##
============================================
+ Coverage     82.17%   82.18%   +0.01%     
- Complexity      935      938       +3     
============================================
  Files            44       44              
  Lines          2154     2161       +7     
============================================
+ Hits           1770     1776       +6     
- Misses          384      385       +1
Impacted Files Coverage Δ Complexity Δ
src/DefinitionResolver.php 87.43% <85.71%> (-0.03%) 335 <0> (+3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants