Skip to content

Commit

Permalink
Merge pull request #2 from OpenBuildings/add-php-version-support
Browse files Browse the repository at this point in the history
Add php version support
  • Loading branch information
trayanivanov authored Feb 14, 2020
2 parents a9f49bc + 76c0d99 commit de62949
Show file tree
Hide file tree
Showing 9 changed files with 1,524 additions and 58 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ language: php
sudo: false

php:
- 5.4
- 5.5
- 5.6
- 7
- 7.1
- 7.2
- 7.3

cache:
directories:
Expand All @@ -27,7 +26,7 @@ before_script:
- mkdir -p build/logs

script:
- phpunit --coverage-clover build/logs/clover.xml
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_script:
- test -e build/logs/clover.xml && wget https://scrutinizer-ci.com/ocular.phar
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ A swiftmailer plugin that allows whitelist / blacklist to which emails to perfor
```php
$mailer = Swift_Mailer::newInstance();

$mailer->registerPLugin(new FilterPlugin(['example.com'], ['test4@example.com', 'test5@example.com']);
$mailer->registerPLugin(new FilterPlugin([
new WhiteListFilter(['example.com']),
new BlacklistFilter(['test4@example.com, test5@example.com'])
]));
```

First argument is whitelist, second is blacklist, they both allow array of emails or domain names. If you assign a domain, all emails from that domain will be whitelisted / blacklisted.

There are additional getters that you might use:

- ``getWhitelist()``
- ``getBlacklist()``
First argument is whitelist filter, second is blacklist filter, they both allow array of emails or domain names. If you assign a domain, all emails from that domain will be whitelisted / blacklisted.

## License

Expand Down
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
}
],
"require" : {
"php": ">=5.4"
"php": "^7.1"
},
"require-dev" : {
"swiftmailer/swiftmailer": "^5.0.0"
"swiftmailer/swiftmailer": "^5.0.0",
"phpunit/phpunit": "^7"
},
"autoload": {
"psr-4": {
Expand All @@ -24,5 +25,10 @@
"psr-4": {
"Openbuildings\\Swiftmailer\\Test\\": "tests/src/"
}
},
"config": {
"platform": {
"php": "7.1.8"
}
}
}
Loading

0 comments on commit de62949

Please sign in to comment.