Skip to content
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 completion support to type hinted local variables. #701

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

2 participants