Skip to content

Commit b2a7ed2

Browse files
author
Jens Prangenberg
authored
Merge pull request #4 from Dropelikeit/feature/upgrade-package
Feature/upgrade package
2 parents 9549394 + 62a199a commit b2a7ed2

File tree

13 files changed

+3560
-808
lines changed

13 files changed

+3560
-808
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
vendor/
2-
.idea/
2+
.idea/
3+
.phpunit.result.cache
4+
.php_cs
5+
.phpstan.neon

.php_cs.dist

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('vendor')
5+
->in(__DIR__)
6+
;
7+
8+
return PhpCsFixer\Config::create()
9+
->setRiskyAllowed(true)
10+
->setRules([
11+
'@PSR2' => true,
12+
'braces' => false,
13+
'array_indentation' => true,
14+
'array_syntax' => [
15+
'syntax' => 'short',
16+
],
17+
'blank_line_after_opening_tag' => true,
18+
'blank_line_before_statement' => true,
19+
'cast_spaces' => true,
20+
'concat_space' => [
21+
'spacing' => 'one',
22+
],
23+
'declare_equal_normalize' => true,
24+
'include' => true,
25+
'function_typehint_space' => true,
26+
'linebreak_after_opening_tag' => true,
27+
'lowercase_cast' => true,
28+
'lowercase_static_reference' => true,
29+
'magic_constant_casing' => true,
30+
'modernize_types_casting' => true,
31+
'native_function_casing' => true,
32+
'new_with_braces' => true,
33+
'no_alternative_syntax' => true,
34+
'no_empty_comment' => true,
35+
'no_empty_statement' => true,
36+
'no_closing_tag' => true,
37+
'no_extra_blank_lines' => true,
38+
'no_leading_import_slash' => true,
39+
'no_leading_namespace_whitespace' => true,
40+
'no_multiline_whitespace_around_double_arrow' => true,
41+
'no_null_property_initialization' => true,
42+
'no_short_bool_cast' => true,
43+
'no_singleline_whitespace_before_semicolons' => true,
44+
'no_spaces_around_offset' => true,
45+
'no_superfluous_elseif' => true,
46+
'no_trailing_comma_in_list_call' => true,
47+
'no_trailing_comma_in_singleline_array' => true,
48+
'no_unneeded_control_parentheses' => true,
49+
'no_unneeded_curly_braces' => true,
50+
'no_unneeded_final_method' => true,
51+
'no_unused_imports' => true,
52+
'no_useless_else' => true,
53+
'no_whitespace_before_comma_in_array' => true,
54+
'no_whitespace_in_blank_line' => true,
55+
'normalize_index_brace' => true,
56+
'object_operator_without_whitespace' => true,
57+
'ordered_imports' => true,
58+
'phpdoc_annotation_without_dot' => true,
59+
'phpdoc_indent' => true,
60+
'phpdoc_inline_tag' => true,
61+
'phpdoc_no_access' => true,
62+
'return_type_declaration' => true,
63+
'short_scalar_cast' => true,
64+
'simplified_null_return' => true,
65+
'single_blank_line_before_namespace' => true,
66+
'single_quote' => true,
67+
'standardize_not_equals' => true,
68+
'ternary_operator_spaces' => true,
69+
'ternary_to_null_coalescing' => true,
70+
'trailing_comma_in_multiline_array' => true,
71+
'trim_array_spaces' => true,
72+
'unary_operator_spaces' => true,
73+
'visibility_required' => true,
74+
'whitespace_after_comma_in_array' => true,
75+
'yoda_style' => false,
76+
77+
/** @risky */
78+
'strict_comparison' => true,
79+
'dir_constant' => true,
80+
'psr4' => true,
81+
])->setFinder($finder);

.travis.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1+
# Project language
12
language: php
23

3-
os:
4-
- linux
4+
# Allows use container-based infrastructure
5+
sudo: false
56

6-
git:
7-
depth: 1
7+
# Start mysql service
8+
#services:
9+
# - mysql
810

9-
php:
10-
- 7.1
11+
# Cache composer packages so "composer install" is faster
12+
cache:
13+
directories:
14+
- $HOME/.composer/cache/files
1115

12-
sudo: false
16+
matrix:
17+
fast_finish: true
18+
include:
19+
- php: 7.4
20+
- php: 8.0
21+
allow_failures:
22+
- php: hhvm
23+
24+
before-install:
25+
- composer self-update
1326

27+
# Install composer dependencies,
28+
# Create database, schema and fixtures
1429
install:
15-
- travis_retry composer install --no-interaction
30+
- composer install
1631
- wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar
1732
- chmod +x php-coveralls.phar
1833
- php php-coveralls.phar --version
1934

20-
before_script:
21-
- mkdir -p build/logs
22-
- ls -al
23-
35+
# Run script
2436
script:
25-
- ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
37+
- phpunit --coverage-clover build/logs/clover.xml
38+
- composer cs-check
39+
- composer analyze
2640

2741
after_success:
2842
- travis_retry php php-coveralls.phar -v
29-
30-
branches:
31-
only: master
32-
33-
notifications:
34-
email:
35-
on_success: never
36-
on_failure: always

composer.json

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "library",
44
"description": "Simple and clean detection SDK for temporary emails",
55
"license": "MIT",
6-
"minimum-stability": "dev",
6+
"minimum-stability": "stable",
77
"authors": [
88
{
99
"name": "Jens Prangenberg",
@@ -12,16 +12,36 @@
1212
],
1313
"homepage": "https://temporary-email-detection.de",
1414
"require": {
15-
"php": "^7.1",
16-
"guzzlehttp/guzzle": "^6.3"
15+
"php": "^7.4|^8.0",
16+
"ext-json": "*",
17+
"guzzlehttp/guzzle": "^7.2"
1718
},
1819
"autoload": {
1920
"psr-4": {
20-
"TemporaryEmailDetection\\": "src/",
21-
"TemporaryEmailDetectionTests\\": "tests/"
21+
"TemporaryEmailDetection\\": "src/"
22+
2223
}
2324
},
2425
"require-dev": {
25-
"phpunit/phpunit": "^7.0@dev"
26+
"phpunit/phpunit": "^9.5",
27+
"friendsofphp/php-cs-fixer": "^2.18",
28+
"phpstan/phpstan": "^0.12.81",
29+
"phpstan/phpstan-phpunit": "^0.12.18"
30+
},
31+
"autoload-dev": {
32+
"psr-4": {
33+
"TemporaryEmailDetectionTests\\": "tests/"
34+
}
35+
},
36+
"scripts": {
37+
"check": [
38+
"@cs-check",
39+
"@test",
40+
"@analyze"
41+
],
42+
"cs-check": "php-cs-fixer -v --dry-run --using-cache=no fix",
43+
"cs-fix": "php-cs-fixer --using-cache=no fix",
44+
"test": "vendor/bin/phpunit --configuration phpunit.xml",
45+
"analyze": "vendor/bin/phpstan analyse --configuration phpstan.neon.dist"
2646
}
2747
}

0 commit comments

Comments
 (0)