mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-20 11:48:27 -06:00
Allow choosing QueryParser implementation
This commit is contained in:
parent
9d9dffee74
commit
9729434926
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Support\Search\GdbotsQueryParser;
|
||||
use FireflyIII\Support\Search\OperatorQuerySearch;
|
||||
use FireflyIII\Support\Search\QueryParser;
|
||||
use FireflyIII\Support\Search\QueryParserInterface;
|
||||
@ -47,10 +48,13 @@ class SearchServiceProvider extends ServiceProvider
|
||||
{
|
||||
$this->app->bind(
|
||||
QueryParserInterface::class,
|
||||
static function (Application $app) {
|
||||
/** @var QueryParser $queryParser */
|
||||
$queryParser = app(QueryParser::class);
|
||||
return $queryParser;
|
||||
static function () {
|
||||
$implementation = env('QUERY_PARSER_IMPLEMENTATION', 'default');
|
||||
|
||||
return match($implementation) {
|
||||
'new' => app(QueryParser::class),
|
||||
default => app(GdbotsQueryParser::class),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user