mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-11-12 13:28:44 +00:00
Add a filter() helper method
Add a namespaced `filter()` method that can be imported via `use function` and use it as an alternative for `new Filter` or `Filter::create()`. This provides a cleaner, easier to read syntax - particularly if you have a lot of filters in the same file.
This commit is contained in:
parent
31cfaf8f6f
commit
330d6f9393
3 changed files with 30 additions and 0 deletions
17
tests/Unit/HelpersTest.php
Normal file
17
tests/Unit/HelpersTest.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
use Opdavies\GmailFilterBuilder\Model\Filter as FilterClass;
|
||||
use function Opdavies\GmailFilterBuilder\filter;
|
||||
|
||||
final class HelpersTest extends TestCase
|
||||
{
|
||||
/** @test */
|
||||
public function it_returns_a_filter_object(): void
|
||||
{
|
||||
$this->assertEquals(new FilterClass(), filter());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue