- WIP on SQLite Adapter and migration

This commit is contained in:
mcndave committed 2023-03-27 18:38:31 +00:00
1 parent cee978ecfd
commit 9514a46ae7
14 files changed
+98 -40

No files matched your search

+5 -5
View File
@@ -123,14 +123,14 @@ class EntityCollection extends \ArrayObject {
return $this;
}
public function search($value, string $field, bool $strict = true) : Generator
public function search(mixed $value, string $field, bool $strict = true) : Generator
{
foreach($this->filters(fn($v) => isset($v->$field) ? ( $strict ? $v->$field === $value : $v->$field == $value ) : false) as $key => $item) {
yield $key => $item;
}
}
public function searchOne($value, string $field, bool $strict = true) : ? object
public function searchOne(mixed $value, string $field, bool $strict = true) : ? object
{
# Returning first value only
foreach($this->search($value, $field, $strict) as $item) {
@@ -140,7 +140,7 @@ class EntityCollection extends \ArrayObject {
return null;
}
public function searchAll(/* mixed*/ $values, string $field, bool $strict = true, bool $compareArray = false) : self
public function searchAll(mixed $values, string $field, bool $strict = true, bool $compareArray = false) : self
{
$collection = new static();
@@ -155,7 +155,7 @@ class EntityCollection extends \ArrayObject {
return $collection;
}
public function diffAll(/* mixed */ $values, string $field, bool $strict = true, bool $compareArray = false) : self
public function diffAll(mixed $values, string $field, bool $strict = true, bool $compareArray = false) : self
{
$obj = new static($this->getArrayCopy());
@@ -214,7 +214,7 @@ class EntityCollection extends \ArrayObject {
return $list;
}
public function unique(\Stringable|callable $field, bool $strict = false) : self
public function unique(\Stringable|callable|string $field, bool $strict = false) : self
{
$list = [];
$obj = new static();