Closed thomascorthals closed 2 months ago
@mkalkbrenner What do you think? Should I just remove object support from Configurable
or do you prefer deprecating it first just to be safe?
I agree with your opinion. We should remove the support entirely.
Solarium version(s) affected: 5.x+ Solr version: N/A Solr mode: N/A
Description According to the docs, Zend_Config can be used when creating a
Client
instance.https://github.com/solariumphp/solarium/blob/19838edfaa4717dc7b12fdaf49e1c964db606d58/docs/queries/select-query/building-a-select-query/building-a-select-query.md?plain=1#L97
However, since #662 the constructor and the methods such as
createSelect()
have anarray $options
type hint that no longer allows passing an object.How to reproduce
Results in:
Possible Solution We could go back and remove this type hint. But since it's been there for quite a while without anyone complaining, I doubt anyone still uses it like that.
I think it's better to completely remove the object support from
Configurable::setOptions()
. Don't even think deprecating it first is necessary if nobody noticed this was broken.It would still be very easy to use config objects if you want. A very small effort on the user's part can cut the complexity out of
Configurable
.Additional context Was actually looking to update the documentation from Zend → Laminas and include a unit test that actually uses
laminas/laminas-config
when I noticed this no longer works. Even the object support inConfigurable
is partly broken, specifically if you try and rely on recursive calls of the internaltoArray()
method.