Add support for __DIR__ and __TRAIT__.
ClosedPublic

Authored by pprkut on Dec 16 2017, 9:54 PM.

Diff Detail

Repository
R52 KDevelop: PHP Support
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
pprkut created this revision.Dec 16 2017, 9:54 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptDec 16 2017, 9:54 PM
pprkut requested review of this revision.Dec 16 2017, 9:54 PM
pprkut updated this revision to Diff 24006.Dec 17 2017, 11:50 AM

Add more test cases in the completion test

brauch accepted this revision.Dec 17 2017, 12:30 PM
brauch added a subscriber: brauch.

I'm not up-to-date with the PHP standard, but guessing what the language feature does, code-wise this looks fine to me.

This revision is now accepted and ready to land.Dec 17 2017, 12:30 PM

__DIR__ is a constant holding the current directory of the file the constant is used in
__TRAIT__ is a constant holding the current name of the trait the constant is used in

Any opinions on where I should merge this? Is it a small enough change to go into 5.2? Risk-wise it should be pretty low, but there is a string change

String change is probably ok if there is enough time before the next release (a few weeks) AFAIU. My two cents about where to merge it would be, put it in 5.2 only if you consider it a bug fix -- i.e. if there are projects which do not parse properly because this feature is missing go for it, otherwise put it in master. There's nothing worse than adding regression bugs in patch releases because of minor features like this.

This revision was automatically updated to reflect the committed changes.