resourceloader: Use -1 instead of null in DerivativeResourceLoaderContext
The ResourceLoaderContext class used null to determine absence of
an overridde in the derivative object.
However three of the members in question allow null as legitimate value.
(Namely 'only', 'user', and 'version').
This makes is impossible for a derivative context to remove one
of those values if the parent context has them set.
Use case: I782df43c needs to create a derivative context of
load.php?only=scripts&modules=startup without 'only'.
Use -1 instead as internal placeholder value.
Also:
* ResourceLoaderContext::getSkin() was documented as returning 'string|null' when in
fact it always has a default value. Never returns null.
* DerivativeResourceLoaderContext::setOnly() and setVersion() were missing
type hint for 'null' (as it was incompatible with their getter). Adding 'false'.
* Swap if/else statements to handle the special case first (inheriting).
Allowing the rest of the function body to handle the local value.
In preparation for further development.
Change-Id: I058884525237effe8aef35469ed7693bb7cea591