Skip to content

Commit 7b49033

Browse files
committed
Query collection has fist argument key for convinience
1 parent 69b1490 commit 7b49033

File tree

10 files changed

+14
-6
lines changed

10 files changed

+14
-6
lines changed

src/Aggregation/RangeValue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public function toArray(): array
5353
$from = $this->from;
5454
$to = $this->to;
5555

56-
if ( ! $this->fromEqual) {
56+
if ( ! $this->fromEqual && \is_int($from)) {
5757
$from++;
5858
}
59-
if ($this->toEqual) {
59+
if ($this->toEqual && \is_int($to)) {
6060
$to++;
6161
}
6262

src/Query/QueryCollection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class QueryCollection implements LeafQueryInterface
3131
* @param int|string|null $key
3232
*/
3333
public function __construct(
34-
?\Spameri\ElasticQuery\Query\MustCollection $mustCollection = NULL
35-
, ?\Spameri\ElasticQuery\Query\ShouldCollection $shouldCollection = NULL
36-
, ?\Spameri\ElasticQuery\Query\MustNotCollection $mustNotCollection = NULL
37-
, $key = NULL
34+
$key = NULL,
35+
?\Spameri\ElasticQuery\Query\MustCollection $mustCollection = NULL,
36+
?\Spameri\ElasticQuery\Query\ShouldCollection $shouldCollection = NULL,
37+
?\Spameri\ElasticQuery\Query\MustNotCollection $mustNotCollection = NULL
3838
)
3939
{
4040
if ( ! $mustCollection) {

tests/SpameriTests/ElasticQuery/ElasticQuery.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class ElasticQuery extends \Tester\TestCase
7171
(
7272
new \Spameri\ElasticQuery\ElasticQuery(
7373
new \Spameri\ElasticQuery\Query\QueryCollection(
74+
NULL,
7475
new \Spameri\ElasticQuery\Query\MustCollection(
7576
$match
7677
)

tests/SpameriTests/ElasticQuery/Query/Fuzzy.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Fuzzy extends \Tester\TestCase
5050
(
5151
new \Spameri\ElasticQuery\ElasticQuery(
5252
new \Spameri\ElasticQuery\Query\QueryCollection(
53+
NULL,
5354
new \Spameri\ElasticQuery\Query\MustCollection(
5455
$fuzzy
5556
)

tests/SpameriTests/ElasticQuery/Query/Match.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class Match extends \Tester\TestCase
5454
(
5555
new \Spameri\ElasticQuery\ElasticQuery(
5656
new \Spameri\ElasticQuery\Query\QueryCollection(
57+
NULL,
5758
new \Spameri\ElasticQuery\Query\MustCollection(
5859
$match
5960
)

tests/SpameriTests/ElasticQuery/Query/MatchPhrase.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class MatchPhrase extends \Tester\TestCase
4848
(
4949
new \Spameri\ElasticQuery\ElasticQuery(
5050
new \Spameri\ElasticQuery\Query\QueryCollection(
51+
NULL,
5152
new \Spameri\ElasticQuery\Query\MustCollection(
5253
$match
5354
)

tests/SpameriTests/ElasticQuery/Query/Range.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Range extends \Tester\TestCase
4646
(
4747
new \Spameri\ElasticQuery\ElasticQuery(
4848
new \Spameri\ElasticQuery\Query\QueryCollection(
49+
NULL,
4950
new \Spameri\ElasticQuery\Query\MustCollection(
5051
$range
5152
)

tests/SpameriTests/ElasticQuery/Query/Term.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class Term extends \Tester\TestCase
4444
(
4545
new \Spameri\ElasticQuery\ElasticQuery(
4646
new \Spameri\ElasticQuery\Query\QueryCollection(
47+
NULL,
4748
new \Spameri\ElasticQuery\Query\MustCollection(
4849
$term
4950
)

tests/SpameriTests/ElasticQuery/Query/Terms.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class Terms extends \Tester\TestCase
4343
(
4444
new \Spameri\ElasticQuery\ElasticQuery(
4545
new \Spameri\ElasticQuery\Query\QueryCollection(
46+
NULL,
4647
new \Spameri\ElasticQuery\Query\MustCollection(
4748
$terms
4849
)

tests/SpameriTests/ElasticQuery/Query/WildCard.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class WildCard extends \Tester\TestCase
4444
(
4545
new \Spameri\ElasticQuery\ElasticQuery(
4646
new \Spameri\ElasticQuery\Query\QueryCollection(
47+
NULL,
4748
new \Spameri\ElasticQuery\Query\MustCollection(
4849
$wildCard
4950
)

0 commit comments

Comments
 (0)