diff --git a/src/Filter.php b/src/Filter.php index 3380eee..05d1bff 100644 --- a/src/Filter.php +++ b/src/Filter.php @@ -20,21 +20,21 @@ class Filter return $this; } - public function from() + public function from($values) { - $this->properties['from'] = collect(func_get_args()) - ->map(function ($address) { - return trim($address); + $this->properties['from'] = collect($values) + ->map(function ($value) { + return trim($value); })->all(); return $this; } - public function to() + public function to($values) { - $this->properties['to'] = collect(func_get_args()) - ->map(function ($address) { - return trim($address); + $this->properties['to'] = collect($values) + ->map(function ($value) { + return trim($value); })->all(); return $this; diff --git a/tests/Unit/BuilderTest.php b/tests/Unit/BuilderTest.php index dd417f7..be05063 100644 --- a/tests/Unit/BuilderTest.php +++ b/tests/Unit/BuilderTest.php @@ -9,7 +9,7 @@ class BuilderTest extends TestCase public function testBuild() { $filterA = (new Filter()) - ->from('foo@example.com', 'test@example.com') + ->from(['foo@example.com', 'test@example.com']) ->label('Some label') ->archive(); diff --git a/tests/Unit/FilterTest.php b/tests/Unit/FilterTest.php index 2aecdb5..0212d46 100644 --- a/tests/Unit/FilterTest.php +++ b/tests/Unit/FilterTest.php @@ -55,7 +55,7 @@ class FilterTest extends TestCase // Ensure that we can set multiple from addresses. $this->assertEquals( ['from' => ['foo@example.com', 'bar@example.com']], - $this->filter->from('foo@example.com', 'bar@example.com') + $this->filter->from(['foo@example.com', 'bar@example.com']) ->getProperties() ); } @@ -72,7 +72,7 @@ class FilterTest extends TestCase $this->assertEquals( ['to' => ['bar@example.com', 'baz@example.com']], - $this->filter->to('bar@example.com', 'baz@example.com') + $this->filter->to(['bar@example.com', 'baz@example.com']) ->getProperties() ); } @@ -240,7 +240,7 @@ class FilterTest extends TestCase 'shouldStar' => 'true', 'shouldAlwaysMarkAsImportant' => 'true', ], - $this->filter->from('foo@example.com ', 'bar@example.com') + $this->filter->from(['foo@example.com ', 'bar@example.com']) ->has('Something') ->excludeChats() ->labelAndArchive('Foo')