Improved type detection for object properties.

Authored by pprkut on Aug 16 2018, 12:28 PM.



This should solve long standing bugs that make kdev-php difficult
to use with common PHP frameworks.

  • Properly resolve namespaced identifiers for type information in the phpdoc block
  • Default type for class properties without assigned value is now NULL instead of 'mixed' (if no other type is specified in the phpdoc block)
  • The NULL type is replaced on first assignment to the property.

BUG: 241750
BUG: 295866
FIXED-IN: 5.3.0

Diff Detail

R52 KDevelop: PHP Support
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
pprkut created this revision.Aug 16 2018, 12:28 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptAug 16 2018, 12:28 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
pprkut requested review of this revision.Aug 16 2018, 12:28 PM
pprkut updated this revision to Diff 39855.Aug 16 2018, 1:14 PM

Added more unit tests for bugs fixed by this :)

pprkut edited the summary of this revision. (Show Details)Aug 16 2018, 1:15 PM
brauch accepted this revision.Aug 17 2018, 9:41 AM
brauch added a subscriber: brauch.

Maybe you make the the visitAssignment code a bit more readable by breaking it up into 2-3 functions?

If you tend to the inline notes, this does not look too wrong ...


move this down below the next condition, it doesn't need it


I don't think you are allowed to unlock the lock here, you are still using the items below ... but in the builder code, stuff like this usually works because you have the parse lock in addition, so no idea.


replace by: DUChainWriteLocker wlock;


remove this, it's unlocked automatically here anyways


as above



This revision is now accepted and ready to land.Aug 17 2018, 9:41 AM

Splitting some code out into a separate function is a bit more tricky than I thought. I have prototype code for it, but it just doesn't quite work right (unit tests don't pass :( ).
I'll merge it for now the way it is and have a look at the refactored version after.

This revision was automatically updated to reflect the committed changes.