-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix solr query types #50
Conversation
Some methods that should be excepting an int are forcing their argument as string. Methods: 'setStart', 'setRows' and 'setExpandRows', 'setTimeAllowed' and 'setGroupOffset'. Instead of forcing the argument to be correct (as an int), we keep BC by allowing strings, but we throw an exception if argument is neither.
@Ingimarsson Here is the new attempt at the type fix. |
@bix0r I compiled it on my machine and did some tests. Looks good. I think it might be better to use the macros |
@Ingimarsson I wanted to use the new ZPP, but the macro we need in this case is |
@bix0r Welcome :) I do think that the code base has too much legacy that has to do more with PHP5 > PHP7 compat, and now PHP 8.0 is reaching EOL, so I don't really think we should support any older versions than the active cycle of the PHP core, as this is an extension by definition. So 8.0 should be the oldest version to support IMHO. I'm thinking about a major refactor, to get rid of all the legacy code that had to with the switch, and to have less things to worry about, especially BC of 5 is not really wise to think about even 7. Another topic would be to modernize the codebase, for the issue at hand, I think we should support the new macros, delegating the handling of method args to the Zend Engine would do us a great favor in terms of future support and stability. So yea, if you would be interested to e-meet sometime next week to discuss the next steps, you're welcome to get in touch via email. Best, |
Hi @omars44, nice to see you back here :) I agree that we should freshen up the code base quite a bit, and I am interested in having an e-meet next week. I will email you. However, I would love to get this fix into master and release a version with it, with all this backwards compatibility. Just so we leave that part in a bit better state (I know many still are using 7.x and some are still supporting it). That should be pretty simple and I think this PR should be ready to be merged. |
I agree with @bix0r : let us have a final PHP 7 release (with this PR merged) before skipping support for 7.x. |
@bix0r I believe these 2 signatures need the same parameter fixes:
|
Related to the last commit. Now fixing types for: SolrCollapseFunction::setSize() SolrDisMaxQuery::setPhraseSlop() SolrDisMaxQuery::setQueryPhraseSlop() SolrDisMaxQuery::setBigramPhraseSlop() SolrDisMaxQuery::setTrigramPhraseSlop()
5323960
to
4d8668d
Compare
@omars44 I found few more methods:
I've fixed all 5 of them. |
@bix0r looks good, can u rebase master and add to NEWS the changelog entry |
@omars44 Perhaps you want to merge the optimize PR before I rebase? |
@bix0r done, thanks |
4d8668d
to
fcfa3d1
Compare
@omars44 Rebased and NEWS updated |
Fix for issue #37, attempt 3.
Previous: PR #38.
This time I manage to skip all BC problems, allowing both strings and integers.