- WIP on PHP 8.2 conversion

This commit is contained in:
Dave Mc Nicoll committed 2023-03-29 11:30:46 -04:00
1 parent 9514a46ae7
commit 3c5aa51850
6 files changed
+44 -35

No files matched your search

+9 -4
View File
@@ -76,7 +76,7 @@ class Where extends Fragment {
protected function whereCondition($field, $value, string $operator = self::OPERATOR_EQUAL, string $condition = self::CONDITION_AND, bool $not = false) {
return new class($this->queryBuilder, $field, $value, $operator, $condition, $not) {
public $value;
public mixed $value;
public bool $not = false;
public string $field;
public string $operator;
@@ -85,7 +85,7 @@ class Where extends Fragment {
protected string $content = "";
public function __construct(QueryBuilderInterface $queryBuilder, string $field, $value, string $operator, string $condition, bool $not) {
public function __construct(QueryBuilderInterface $queryBuilder, string $field, mixed $value, string $operator, string $condition, bool $not) {
$this->queryBuilder = $queryBuilder;
$this->field = $field;
$this->value = $value;
@@ -122,8 +122,13 @@ class Where extends Fragment {
if ( is_array($this->value) ) {
$stack = [];
foreach($this->value as $item) {
$stack[] = $this->filterValue($item);
if ($this->value) {
foreach ($this->value as $item) {
$stack[] = $this->filterValue($item);
}
}
else {
$stack[] = $this->filterValue(false);
}
return "(" . implode(", ", $stack) . ")";
+1 -1
View File
@@ -4,4 +4,4 @@
namespace Ulmus\Query;
interface WhereRawParameter {}
interface WhereRawParameter extends \Stringable {}