Skip to content

Commit 25534bd

Browse files
committed
Refactor query builder concerns and reorganize classes
This modularizes query logic, improves maintainability, and clarifies class responsibilities.
1 parent 4de4462 commit 25534bd

14 files changed

Lines changed: 659 additions & 603 deletions

src/Connection.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
use PDPhilip\Elasticsearch\Exceptions\QueryException;
2626
use PDPhilip\Elasticsearch\Laravel\Compatibility\Connection\ConnectionCompatibility;
2727
use PDPhilip\Elasticsearch\Query\Builder;
28-
use PDPhilip\Elasticsearch\Query\Processor;
2928
use PDPhilip\Elasticsearch\Schema\Blueprint;
3029
use PDPhilip\Elasticsearch\Traits\HasOptions;
3130
use RuntimeException;
@@ -38,7 +37,7 @@
3837
/**
3938
* @mixin Client
4039
*
41-
* @method Processor getPostProcessor()
40+
* @method Query\Processor\Processor getPostProcessor()
4241
*/
4342
class Connection extends BaseConnection
4443
{
@@ -55,7 +54,7 @@ class Connection extends BaseConnection
5554
protected string $connectionName = '';
5655

5756
/**
58-
* @var Query\Processor
57+
* @var Query\Processor\Processor
5958
*/
6059
protected $postProcessor;
6160

@@ -82,7 +81,7 @@ public function __construct(array $config)
8281

8382
$this->connection = $this->createConnection();
8483

85-
$this->postProcessor = new Query\Processor;
84+
$this->postProcessor = new Query\Processor\Processor;
8685

8786
$this->useDefaultSchemaGrammar();
8887

@@ -326,9 +325,9 @@ public function getSchemaBuilder()
326325
}
327326

328327
/** {@inheritdoc} */
329-
protected function getDefaultPostProcessor(): Query\Processor
328+
protected function getDefaultPostProcessor(): Query\Processor\Processor
330329
{
331-
return new Query\Processor;
330+
return new Query\Processor\Processor;
332331
}
333332

334333
public function getDefaultLimit(): int

src/Laravel/v11/Connection/ConnectionCompatibility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public function getSchemaGrammar()
1717
}
1818

1919
/** {@inheritdoc} */
20-
protected function getDefaultQueryGrammar(): Query\Grammar
20+
protected function getDefaultQueryGrammar(): Query\Grammar\Grammar
2121
{
2222
// @phpstan-ignore-next-line
23-
return new Query\Grammar;
23+
return new Query\Grammar\Grammar;
2424
}
2525

2626
/** {@inheritdoc} */

src/Laravel/v12/Connection/ConnectionCompatibility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public function getSchemaGrammar()
1616
}
1717

1818
/** {@inheritdoc} */
19-
protected function getDefaultQueryGrammar(): Query\Grammar
19+
protected function getDefaultQueryGrammar(): Query\Grammar\Grammar
2020
{
21-
return new Query\Grammar($this);
21+
return new Query\Grammar\Grammar($this);
2222
}
2323

2424
/** {@inheritdoc} */

0 commit comments

Comments
 (0)