mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-06-29 11:51:02 +01:00
53 lines
897 B
PHP
53 lines
897 B
PHP
|
<?php
|
||
|
|
||
|
namespace Opdavies\GmailFilterBuilder;
|
||
|
|
||
|
class Filter
|
||
|
{
|
||
|
public function has($value)
|
||
|
{
|
||
|
return ['hasTheWord' => $value];
|
||
|
}
|
||
|
|
||
|
public function from()
|
||
|
{
|
||
|
return ['from' => func_get_args()];
|
||
|
}
|
||
|
|
||
|
public function label($label)
|
||
|
{
|
||
|
return ['label' => $label];
|
||
|
}
|
||
|
|
||
|
public function archive()
|
||
|
{
|
||
|
return ['shouldArchive' => 'true'];
|
||
|
}
|
||
|
|
||
|
public function labelAndArchive($label)
|
||
|
{
|
||
|
return $this->label($label) + $this->archive();
|
||
|
}
|
||
|
|
||
|
public function spam()
|
||
|
{
|
||
|
return [
|
||
|
'shouldSpam' => 'true',
|
||
|
'shouldNeverSpam' => 'false',
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public function neverSpam()
|
||
|
{
|
||
|
return [
|
||
|
'shouldSpam' => 'false',
|
||
|
'shouldNeverSpam' => 'true',
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public function trash()
|
||
|
{
|
||
|
return ['shouldTrash' => 'true'];
|
||
|
}
|
||
|
}
|