Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
General code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2018 at 20:56 UTC
Updated:
17 Mar 2018 at 15:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
drunken monkeyThis would be a patch.
Reasonably, PHP doesn't allow
staticwhere class constants are used at compile time, so a fewself::instances remained. (Plus some inQuery::sort()where the parameter defaults toself::SORT_ASCso I found it confusing to switch the rest.)Comment #3
drunken monkeyThinking about it a bit more, it might actually be a good idea to switch almost all constant references to use
self::– otherwise, the constants aren't really constant. If someone would actually override them in a child class (sostaticvs.selfwould actually matter), this would just be a recipe for chaos.So, at least as long as the constants are also used outside of the defining class (not the case for the DB backend – and overriding there might actually serve a purpose),
self::makes more sense.Input welcome, in any case.
Comment #4
borisson_I agree with #3, conts should use
self::, methods should bestatic::Comment #6
drunken monkeyAlright, then, thanks for your input and work!
Committed.