File tree Expand file tree Collapse file tree 15 files changed +78
-83
lines changed
Expand file tree Collapse file tree 15 files changed +78
-83
lines changed Original file line number Diff line number Diff line change 44.github export-ignore
55.gitattributes export-ignore
66.gitignore export-ignore
7- .php_cs export-ignore
7+ .php-cs-fixer.dist.php export-ignore
88phpunit.xml.dist export-ignore
Original file line number Diff line number Diff line change @@ -13,18 +13,18 @@ jobs:
1313 fail-fast : false
1414 matrix :
1515 php-version :
16- - ' 7.1'
17- - ' 7.2'
18- - ' 7.3'
19- - ' 7.4'
2016 - ' 8.0'
2117 - ' 8.1'
2218 - ' 8.2'
2319 - ' 8.3'
2420 - ' 8.4'
2521 - ' 8.5'
22+ dependencies : [highest]
23+ include :
24+ - php-version : ' 8.0'
25+ dependencies : lowest
2626
27- name : PHP ${{ matrix.php-version }}
27+ name : PHP ${{ matrix.php-version }} ${{ matrix.dependencies }}
2828
2929 steps :
3030 - name : Checkout code
3636 php-version : ${{ matrix.php-version }}
3737 coverage : none
3838
39- - name : Install dependencies
40- run : composer install --prefer-dist --no-progress --no-interaction
39+ - name : Install Composer dependencies (${{ matrix.dependencies }})
40+ uses : ramsey/composer-install@v3
41+ with :
42+ dependency-versions : ${{ matrix.dependencies }}
4143
4244 - name : Run tests
4345 run : composer test
46+
47+ lint :
48+ runs-on : ubuntu-latest
49+
50+ name : PHP Cs Fixer
51+
52+ steps :
53+ - name : Checkout code
54+ uses : actions/checkout@v4
55+
56+ - name : Setup PHP
57+ uses : shivammathur/setup-php@v2
58+ with :
59+ php-version : 8.5
60+ coverage : none
61+
62+ - name : Install Composer dependencies
63+ uses : ramsey/composer-install@v3
64+
65+ - name : Run lint
66+ run : composer lint
Original file line number Diff line number Diff line change 1- /.php_cs .cache
1+ /.php-cs-fixer .cache
22/.phpunit.result.cache
33/composer.lock
44/vendor
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ $ header = <<<EOF
4+ This file is part of the EmailChecker package.
5+
6+ (c) Matthieu Moquet <[email protected] > 7+
8+ This source file is subject to the MIT license that is bundled
9+ with this source code in the file LICENSE.
10+ EOF ;
11+
12+ $ finder = PhpCsFixer \Finder::create ()
13+ ->files ()
14+ ->in (__DIR__ )
15+ ->exclude ('res ' )
16+ ->exclude ('tests/bootstrap.php ' )
17+ ->exclude ('vendor ' )
18+ ->name ('*.php ' );
19+
20+ return (new PhpCsFixer \Config ())
21+ ->setRules ([
22+ '@Symfony ' => true ,
23+ 'header_comment ' => [
24+ 'header ' => $ header ,
25+ ]
26+ ])
27+ ->setFinder ($ finder );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11# EmailChecker
22
3- [ ![ Build status...] ( https://img.shields.io/travis/MattKetmo/EmailChecker.svg )] ( http://travis-ci.org/MattKetmo/EmailChecker )
43[ ![ Code quality...] ( https://img.shields.io/scrutinizer/g/MattKetmo/EmailChecker.svg )] ( https://scrutinizer-ci.com/g/MattKetmo/EmailChecker/ )
54[ ![ Downloads] ( https://img.shields.io/packagist/dt/mattketmo/email-checker.svg )] ( https://packagist.org/packages/mattketmo/email-checker )
65[ ![ Packagist] ( http://img.shields.io/packagist/v/mattketmo/email-checker.svg )] ( https://packagist.org/packages/mattketmo/email-checker )
5756You can build your own adapter (to use another database) simply by implementing
5857the [ AdapterInterface] ( src/EmailChecker/Adapter/AdapterInterface.php ) .
5958
60- ## Integration with Symfony2
59+ ## Integration with Symfony
6160
62- This library also provides a constraint validation for your Symfony2 project:
61+ This library also provides a constraint validation for your Symfony project:
6362
6463``` php
6564<?php
@@ -69,17 +68,15 @@ use Symfony\Component\Validator\Constraints as Assert;
6968
7069class User
7170{
72- /**
73- * @Assert\NotBlank
74- * @EmailCheckerAssert\NotThrowawayEmail
75- */
76- protected $email;
71+ #[Assert\NotBlank]
72+ #[EmailCheckerAssert\NotThrowawayEmail]
73+ private string $email;
7774}
7875```
7976
80- ## Integration with Laravel 5
77+ ## Integration with Laravel
8178
82- To integrate this library with your Laravel 5.x project add the following
79+ To integrate this library with your Laravel project add the following
8380line to the ` providers ` key within your ` config/app.php ` file:
8481
8582``` php
Original file line number Diff line number Diff line change 1010 }
1111 ],
1212 "require" : {
13- "php" : " ^7.1 || ^ 8.0"
13+ "php" : " ^8.0"
1414 },
1515 "require-dev" : {
16- "friendsofphp/php-cs-fixer" : " ^2.18 " ,
17- "illuminate/support" : " ^5 .0 || ^6 .0 || ^7 .0 || ^8 .0" ,
18- "knplabs/gaufrette" : " ^0.10 " ,
19- "phpunit/phpunit" : " ^7.5 || ^ 9.5" ,
20- "symfony/validator" : " ^3.0 || ^4.0 || ^5 .0"
16+ "friendsofphp/php-cs-fixer" : " ^3.91 " ,
17+ "illuminate/support" : " ^9 .0 || ^10 .0 || ^11 .0 || ^12 .0" ,
18+ "knplabs/gaufrette" : " ^0.11 " ,
19+ "phpunit/phpunit" : " ^9.5" ,
20+ "symfony/validator" : " ^5.4 || ^6.4 || ^7 .0"
2121 },
2222 "suggest" : {
2323 "symfony/validator" : " Add validation constraints" ,
Original file line number Diff line number Diff line change @@ -29,18 +29,13 @@ public function __construct(array $adapters)
2929 {
3030 foreach ($ adapters as $ adapter ) {
3131 if (!$ adapter instanceof AdapterInterface) {
32- throw new \InvalidArgumentException (
33- 'AgregatorAdapter only accept instances of AdapterInterface '
34- );
32+ throw new \InvalidArgumentException ('AgregatorAdapter only accept instances of AdapterInterface ' );
3533 }
3634 }
3735
3836 $ this ->adapters = $ adapters ;
3937 }
4038
41- /**
42- * {@inheritdoc}
43- */
4439 public function isThrowawayDomain ($ domain )
4540 {
4641 foreach ($ this ->adapters as $ adapter ) {
Original file line number Diff line number Diff line change @@ -28,9 +28,6 @@ public function __construct(array $domains)
2828 $ this ->domains = $ domains ;
2929 }
3030
31- /**
32- * {@inheritdoc}
33- */
3431 public function isThrowawayDomain ($ domain )
3532 {
3633 return in_array ($ domain , $ this ->domains );
Original file line number Diff line number Diff line change @@ -34,9 +34,6 @@ public function __construct($filename)
3434 $ this ->domains = Utilities::parseLines (file_get_contents ($ filename ));
3535 }
3636
37- /**
38- * {@inheritdoc}
39- */
4037 public function isThrowawayDomain ($ domain )
4138 {
4239 return in_array ($ domain , $ this ->domains );
You can’t perform that action at this time.
0 commit comments