scullwm / inboxsearch
wip
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 4
Forks: 1
Open Issues: 0
Type:standalone
Requires
- php: >=5.4
Requires (Dev)
- atoum/atoum: ~2.5
This package is not auto-updated.
Last update: 2025-01-17 01:05:57 UTC
README
Search operators library. See more from Gmail: https://support.google.com/mail/answer/7190?hl=en
Supported operators
- 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)
How to use
$term = 'from:thomas@scullwm.com forum'; $factory = new InboxSearchFactory($term); // return InboxSearchInterface $inboxSearch = $factory->process(); $from = $inboxSearch->getFrom(); // thomas@scullwm.com $keyword = $inboxSearch->getKeyword(); // array('from' => 'forum') $fromKeyword = $inboxSearch->getKeywordFor(InboxSearchInterface::FILTER_FROM); // forum
Create your own filter
Filter must implement FilterInterface
.
Then register the filter in your factory instance
$factory = new InboxSearchFactory($term); $myFilterParserFqcn = 'Swm\InboxSearch\FilterModel\MyCustomFilter'; $factory->addFilterParser($myFilterParserFqcn);
Tests
php composer install --dev bin/atoum -d tests/units