Search operators library. See more from Gmail: https://support.google.com/mail/answer/7190?hl=en
- Filename (string)
- Size (integer - convert string in bytes)
- Has (string)
- From (string)
- To (string)
- Subject (string)
- Label (string)
- Delivered To (string)
- After (\DateTime)
- Before (\DateTime)
- Older (\DateTime)
- Newer (\DateTime)
- In (string)
$term = 'from:[email protected] forum';
$factory = new InboxSearchFactory($term);
// return InboxSearchInterface
$inboxSearch = $factory->process();
$from = $inboxSearch->getFrom(); // [email protected]
$keyword = $inboxSearch->getKeyword(); // array('from' => 'forum')
$fromKeyword = $inboxSearch->getKeywordFor(InboxSearchInterface::FILTER_FROM); // forum
Filter must implement FilterInterface
.
Then register the filter in your factory instance
$factory = new InboxSearchFactory($term);
$myFilterParserFqcn = 'Swm\InboxSearch\FilterModel\MyCustomFilter';
$factory->addFilterParser($myFilterParserFqcn);
php composer install --dev
bin/atoum -d tests/units