mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-11-15 22:38:46 +00:00
Get FilterTest passing again for now
This commit is contained in:
parent
5d5d5118ef
commit
21a6f431db
2 changed files with 12 additions and 2 deletions
|
|
@ -274,7 +274,17 @@ class Filter
|
|||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return $this->properties;
|
||||
return collect($this->properties)->merge(
|
||||
$this->conditions->flatten(1)->mapWithKeys(function (FilterCondition $condition) {
|
||||
$values = $condition->getValues();
|
||||
|
||||
return [
|
||||
$condition->getProperty() => $values->count() == 1
|
||||
? $values->first()
|
||||
: $values
|
||||
];
|
||||
})
|
||||
)->toArray();
|
||||
}
|
||||
|
||||
public function getConditions(): Collection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue