Closed neural-wetware closed 7 years ago
Ok, this looks good to me. I thought there was an interface
for negotiators, which is not the case so this should be BC.
thanks @neural-wetware!
Please see #87
@willdurand using func_num_args
with func_get_arg
should fix your bc issue ;)
if (3 >= func_num_args()) {
$strict = func_get_arg(2);
} else {
$strict = false;
}
Yeah, not a huge fan of hacks.
@willdurand why would it be a hack? This is provided by php and is known in other languages as well. Btw it is also used in symfony for bc layers.
Add
$strict
parameter togetBest()
to enable exceptions for invalid media types. Defaults tofalse
so is backwards compatible.