Fix bug in SQL-based search
Using PHPStan static analyzer, it found an undefined variable $field in SqlSearch::resolveExactCondition(). This bug is a remnant from a refactoring that took place in #361.
The attached commit should fix that and reduce the complexity of the code a bit.
Hey, thanks for the PR. This looks nice, but is there any reason why are we making the closure static?
A non-static closure holds a reference to $this. This reference causes a very slight overhead and also it is not necessary. Removing the reference to $this therefore makes the code a bit faster and clearer. I just consider making closures static best practice, it doesn't change the way this works.