Skip to content

Commit

Permalink
Merge pull request #5 from Dropelikeit/feature/implemented_interfaces
Browse files Browse the repository at this point in the history
ClientInterface and ClientFactoryInterface and Github workflows added.
  • Loading branch information
Jens Prangenberg authored Jul 1, 2021
2 parents b2a7ed2 + 5b5fff5 commit eb3154a
Show file tree
Hide file tree
Showing 12 changed files with 1,206 additions and 296 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "CI Tests"

on:
pull_request:
push:

jobs:
php8:
name: PHP 8
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

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

- name: "Cache composer packages"
uses: "actions/cache@v2"
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"
run: "composer test"

- name: "Run PHP CS Check"
run: "composer cs-check"

- name: "Run PHPStan"
run: "composer analyze"
php74:
name: PHP 7.4
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

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

- name: "Cache composer packages"
uses: "actions/cache@v2"
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"
run: "composer test"

- name: "Run PHP CS Check"
run: "composer cs-check"

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

- name: "Run Psalm"
run: "composer static-analysis"
10 changes: 5 additions & 5 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
->exclude('vendor')
;

return PhpCsFixer\Config::create()
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
Expand Down Expand Up @@ -57,7 +58,7 @@
'ordered_imports' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'return_type_declaration' => true,
'short_scalar_cast' => true,
Expand All @@ -67,7 +68,7 @@
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => true,
Expand All @@ -77,5 +78,4 @@
/** @risky */
'strict_comparison' => true,
'dir_constant' => true,
'psr4' => true,
])->setFinder($finder);
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ $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
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require": {
"php": "^7.4|^8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "^7.2"
"guzzlehttp/guzzle": "^7.3"
},
"autoload": {
"psr-4": {
Expand All @@ -24,9 +24,11 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"friendsofphp/php-cs-fixer": "^2.18",
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan": "^0.12.81",
"phpstan/phpstan-phpunit": "^0.12.18"
"phpstan/phpstan-phpunit": "^0.12.18",
"vimeo/psalm": "^4.8",
"psalm/plugin-phpunit": "^0.16.1"
},
"autoload-dev": {
"psr-4": {
Expand All @@ -37,11 +39,13 @@
"check": [
"@cs-check",
"@test",
"@analyze"
"@analyze",
"@static-analysis"
],
"cs-check": "php-cs-fixer -v --dry-run --using-cache=no fix",
"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"
"analyze": "vendor/bin/phpstan analyse --configuration phpstan.neon.dist",
"static-analysis": "psalm --shepherd --stats"
}
}
Loading

0 comments on commit eb3154a

Please sign in to comment.