Skip to content

Commit

Permalink
Removed PHP 7.4 support
Browse files Browse the repository at this point in the history
- updated all dependencies
- removed composer.lock
- updated psalm configuration
- added configuration for coverage result output to phpunit.xml
- Used constructor property promotion in client class
- added GitHub action ci jobs for php 8.1 and 8.2
- updated configuration of php-cs-fixer
  • Loading branch information
Dropelikeit committed Jan 23, 2023
1 parent eb3154a commit d34a840
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 5,135 deletions.
75 changes: 65 additions & 10 deletions .github/workflows/ci.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

Expand All @@ -20,7 +20,7 @@ jobs:
php-version: "8"

- name: "Cache composer packages"
uses: "actions/cache@v2"
uses: "actions/cache@v3"
with:
path: "~/.composer/cache"
key: "php-composer-locked-${{ hashFiles('composer.lock') }}"
Expand All @@ -30,29 +30,38 @@ jobs:
run: "composer install --no-interaction"

- name: "Run PHPUnit Tests"
run: "composer test"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer test
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/tests/coverage.xml --json_path=build/tests/coveralls-upload.json -v
- name: "Run PHP CS Check"
run: "composer cs-check"

- name: "Run PHPStan"
run: "composer analyze"
php74:
name: PHP 7.4

- name: "Run Psalm"
run: "composer static-analysis"

php81:
name: PHP 8.1
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

- name: "Install PHP 7.4"
- name: "Install PHP 8.1"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
php-version: "8.1"

- name: "Cache composer packages"
uses: "actions/cache@v2"
uses: "actions/cache@v3"
with:
path: "~/.composer/cache"
key: "php-composer-locked-${{ hashFiles('composer.lock') }}"
Expand All @@ -62,7 +71,12 @@ jobs:
run: "composer install --no-interaction"

- name: "Run PHPUnit Tests"
run: "composer test"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer test
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/tests/coverage.xml --json_path=build/tests/coveralls-upload.json -v
- name: "Run PHP CS Check"
run: "composer cs-check"
Expand All @@ -72,3 +86,44 @@ jobs:

- name: "Run Psalm"
run: "composer static-analysis"

php82:
name: PHP 8.2
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

- name: "Install PHP 8.2"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"

- name: "Cache composer packages"
uses: "actions/cache@v3"
with:
path: "~/.composer/cache"
key: "php-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction"

- name: "Run PHPUnit Tests"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer test
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/tests/coverage.xml --json_path=build/tests/coveralls-upload.json -v
- name: "Run PHP CS Check"
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"

- name: "Run PHPStan"
run: "composer analyze"

- name: "Run Psalm"
run: "composer static-analysis"
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,3 +3,5 @@ vendor/
.phpunit.result.cache
.php_cs
.phpstan.neon
composer.lock
.php-cs-fixer.cache
3 changes: 1 addition & 2 deletions .php-cs-fixer.dist.php
Expand Up @@ -44,8 +44,7 @@
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_comma_in_singleline' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -8,7 +8,7 @@ Simple and clean SDK for https://temporary-email-detection.de
https://packagist.org/packages/jprangenbergde/temporary-email-detection

## Installation
```
```bash
composer require jprangenbergde/temporary-email-detection
```

Expand All @@ -28,5 +28,7 @@ $isTemporary = $client->isTemporary('jens-prangenberg.de'); // false
```
## Extensions
Laravel: https://github.com/Dropelikeit/temporary-email-validator

Symfony: https://github.com/Dropelikeit/temporary-email-validator-bundle

Laminas / Mezzio: https://github.com/Dropelikeit/laminas-temporary-email-validator
18 changes: 9 additions & 9 deletions composer.json
Expand Up @@ -12,9 +12,9 @@
],
"homepage": "https://temporary-email-detection.de",
"require": {
"php": "^7.4|^8.0",
"php": "^8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "^7.3"
"guzzlehttp/guzzle": "^7.5"
},
"autoload": {
"psr-4": {
Expand All @@ -24,11 +24,11 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan": "^0.12.81",
"phpstan/phpstan-phpunit": "^0.12.18",
"vimeo/psalm": "^4.8",
"psalm/plugin-phpunit": "^0.16.1"
"friendsofphp/php-cs-fixer": "^3.13",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-phpunit": "^1.3",
"vimeo/psalm": "^5.6",
"psalm/plugin-phpunit": "^0.18.4"
},
"autoload-dev": {
"psr-4": {
Expand All @@ -44,8 +44,8 @@
],
"cs-check": "php-cs-fixer -vv --dry-run --using-cache=no fix",
"cs-fix": "php-cs-fixer --using-cache=no fix",
"test": "vendor/bin/phpunit --configuration phpunit.xml",
"analyze": "vendor/bin/phpstan analyse --configuration phpstan.neon.dist",
"test": "phpunit --configuration phpunit.xml",
"analyze": "phpstan analyse --no-progress --xdebug --memory-limit=-1",
"static-analysis": "psalm --shepherd --stats"
}
}

0 comments on commit d34a840

Please sign in to comment.