Skip to content

Commit 33eebe4

Browse files
committed
pull #9 ensure fromArray brings in bool operator as well and update doc block and changelog
1 parent ad1e4d5 commit 33eebe4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG-0.x.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
This changelog references the relevant changes done in 0.x versions.
33

44

5+
## v0.2.1
6+
* pull #9: Respect boolean operator preceding subquery.
7+
8+
59
## v0.2.0
610
__BREAKING CHANGES__
711

src/Node/Subquery.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ final class Subquery extends Node
1717
* Subquery constructor.
1818
*
1919
* @param Node[] $nodes
20+
* @param BoolOperator $boolOperator
2021
* @param bool $useBoost
2122
* @param float|mixed $boost
2223
*
@@ -54,7 +55,13 @@ public static function fromArray(array $data = [])
5455
}
5556
}
5657

57-
return new self($nodes, $useBoost, $boost);
58+
try {
59+
$boolOperator = isset($data['bool_operator']) ? BoolOperator::create($data['bool_operator']) : null;
60+
} catch (\Exception $e) {
61+
$boolOperator = null;
62+
}
63+
64+
return new self($nodes, $boolOperator, $useBoost, $boost);
5865
}
5966

6067
/**

0 commit comments

Comments
 (0)