Skip to content

Commit 0b5fbdf

Browse files
author
Joep Roebroek
committed
Merge remote-tracking branch 'sebastianbergmann/master'
2 parents 66f29b9 + 5a03e94 commit 0b5fbdf

File tree

158 files changed

+4291
-4545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+4291
-4545
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
/tools export-ignore
2+
13
*.php diff=php
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Please refer to [https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) for details on how to contribute to this project.
1+
Please refer to [https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/.github/CONTRIBUTING.md) for details on how to contribute to this project.

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: sebastianbergmann

.github/ISSUE_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
| Q | A
2+
| --------------------------| ---------------
3+
| php-code-coverage version | x.y.z
4+
| PHP version | x.y.z
5+
| Driver | Xdebug / PHPDBG
6+
| Xdebug version (if used) | x.y.z
7+
| Installation Method | Composer / PHPUnit PHAR
8+
| Usage Method | PHPUnit / other
9+
| PHPUnit version (if used) | x.y.z
10+
11+
<!--
12+
- Please fill in this template according to your issue.
13+
- Please keep the table shown above at the top of your issue.
14+
- Please post code as text (using proper markup). Do not post screenshots of code.
15+
- For support request or how-tos, visit https://phpunit.de/support.html
16+
- Otherwise, replace this comment by the description of your issue.
17+
-->
18+

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
build/api
2-
build/code-browser
3-
build/coverage
4-
build/logs
5-
build/pdepend
6-
cache.properties
71
/tests/_files/tmp
82
/vendor
93
/composer.lock
10-
/composer.phar
114
/.idea
5+
/.php_cs
126
/.php_cs.cache
7+
/.phpunit.result.cache

.php_cs

Lines changed: 0 additions & 69 deletions
This file was deleted.

.php_cs.dist

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
<?php declare(strict_types=1);
2+
$header = <<<'EOF'
3+
This file is part of the php-code-coverage package.
4+
5+
(c) Sebastian Bergmann <[email protected]>
6+
7+
For the full copyright and license information, please view the LICENSE
8+
file that was distributed with this source code.
9+
EOF;
10+
11+
return PhpCsFixer\Config::create()
12+
->setRiskyAllowed(true)
13+
->setRules(
14+
[
15+
'align_multiline_comment' => true,
16+
'array_indentation' => true,
17+
'array_syntax' => ['syntax' => 'short'],
18+
'binary_operator_spaces' => [
19+
'operators' => [
20+
'=' => 'align',
21+
'=>' => 'align',
22+
],
23+
],
24+
'blank_line_after_namespace' => true,
25+
'blank_line_before_statement' => [
26+
'statements' => [
27+
'break',
28+
'continue',
29+
'declare',
30+
'do',
31+
'for',
32+
'foreach',
33+
'if',
34+
'include',
35+
'include_once',
36+
'require',
37+
'require_once',
38+
'return',
39+
'switch',
40+
'throw',
41+
'try',
42+
'while',
43+
'yield',
44+
],
45+
],
46+
'braces' => true,
47+
'cast_spaces' => true,
48+
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
49+
'combine_consecutive_issets' => true,
50+
'combine_consecutive_unsets' => true,
51+
'compact_nullable_typehint' => true,
52+
'concat_space' => ['spacing' => 'one'],
53+
'declare_equal_normalize' => ['space' => 'none'],
54+
'declare_strict_types' => true,
55+
'dir_constant' => true,
56+
'elseif' => true,
57+
'encoding' => true,
58+
'full_opening_tag' => true,
59+
'function_declaration' => true,
60+
'header_comment' => ['header' => $header, 'separate' => 'none'],
61+
'indentation_type' => true,
62+
'is_null' => true,
63+
'line_ending' => true,
64+
'list_syntax' => ['syntax' => 'short'],
65+
'logical_operators' => true,
66+
'lowercase_cast' => true,
67+
'lowercase_constants' => true,
68+
'lowercase_keywords' => true,
69+
'lowercase_static_reference' => true,
70+
'magic_constant_casing' => true,
71+
'method_argument_space' => ['ensure_fully_multiline' => true],
72+
'modernize_types_casting' => true,
73+
'multiline_comment_opening_closing' => true,
74+
'multiline_whitespace_before_semicolons' => true,
75+
'native_constant_invocation' => true,
76+
'native_function_casing' => true,
77+
'native_function_invocation' => true,
78+
'new_with_braces' => false,
79+
'no_alias_functions' => true,
80+
'no_alternative_syntax' => true,
81+
'no_blank_lines_after_class_opening' => true,
82+
'no_blank_lines_after_phpdoc' => true,
83+
'no_blank_lines_before_namespace' => true,
84+
'no_closing_tag' => true,
85+
'no_empty_comment' => true,
86+
'no_empty_phpdoc' => true,
87+
'no_empty_statement' => true,
88+
'no_extra_blank_lines' => true,
89+
'no_homoglyph_names' => true,
90+
'no_leading_import_slash' => true,
91+
'no_leading_namespace_whitespace' => true,
92+
'no_mixed_echo_print' => ['use' => 'print'],
93+
'no_multiline_whitespace_around_double_arrow' => true,
94+
'no_null_property_initialization' => true,
95+
'no_php4_constructor' => true,
96+
'no_short_bool_cast' => true,
97+
'no_short_echo_tag' => true,
98+
'no_singleline_whitespace_before_semicolons' => true,
99+
'no_spaces_after_function_name' => true,
100+
'no_spaces_inside_parenthesis' => true,
101+
'no_superfluous_elseif' => true,
102+
'no_superfluous_phpdoc_tags' => true,
103+
'no_trailing_comma_in_list_call' => true,
104+
'no_trailing_comma_in_singleline_array' => true,
105+
'no_trailing_whitespace' => true,
106+
'no_trailing_whitespace_in_comment' => true,
107+
'no_unneeded_control_parentheses' => true,
108+
'no_unneeded_curly_braces' => true,
109+
'no_unneeded_final_method' => true,
110+
'no_unreachable_default_argument_value' => true,
111+
'no_unset_on_property' => true,
112+
'no_unused_imports' => true,
113+
'no_useless_else' => true,
114+
'no_useless_return' => true,
115+
'no_whitespace_before_comma_in_array' => true,
116+
'no_whitespace_in_blank_line' => true,
117+
'non_printable_character' => true,
118+
'normalize_index_brace' => true,
119+
'object_operator_without_whitespace' => true,
120+
'ordered_class_elements' => [
121+
'order' => [
122+
'use_trait',
123+
'constant_public',
124+
'constant_protected',
125+
'constant_private',
126+
'property_public_static',
127+
'property_protected_static',
128+
'property_private_static',
129+
'property_public',
130+
'property_protected',
131+
'property_private',
132+
'method_public_static',
133+
'construct',
134+
'destruct',
135+
'magic',
136+
'phpunit',
137+
'method_public',
138+
'method_protected',
139+
'method_private',
140+
'method_protected_static',
141+
'method_private_static',
142+
],
143+
],
144+
'ordered_imports' => true,
145+
'phpdoc_add_missing_param_annotation' => true,
146+
'phpdoc_align' => true,
147+
'phpdoc_annotation_without_dot' => true,
148+
'phpdoc_indent' => true,
149+
'phpdoc_no_access' => true,
150+
'phpdoc_no_empty_return' => true,
151+
'phpdoc_no_package' => true,
152+
'phpdoc_order' => true,
153+
'phpdoc_return_self_reference' => true,
154+
'phpdoc_scalar' => true,
155+
'phpdoc_separation' => true,
156+
'phpdoc_single_line_var_spacing' => true,
157+
'phpdoc_to_comment' => true,
158+
'phpdoc_trim' => true,
159+
'phpdoc_trim_consecutive_blank_line_separation' => true,
160+
'phpdoc_types' => ['groups' => ['simple', 'meta']],
161+
'phpdoc_types_order' => true,
162+
'phpdoc_var_without_name' => true,
163+
'pow_to_exponentiation' => true,
164+
'protected_to_private' => true,
165+
'return_assignment' => true,
166+
'return_type_declaration' => ['space_before' => 'none'],
167+
'self_accessor' => true,
168+
'semicolon_after_instruction' => true,
169+
'set_type_to_cast' => true,
170+
'short_scalar_cast' => true,
171+
'simplified_null_return' => true,
172+
'single_blank_line_at_eof' => true,
173+
'single_import_per_statement' => true,
174+
'single_line_after_imports' => true,
175+
'single_quote' => true,
176+
'standardize_not_equals' => true,
177+
'ternary_to_null_coalescing' => true,
178+
'trailing_comma_in_multiline_array' => true,
179+
'trim_array_spaces' => true,
180+
'unary_operator_spaces' => true,
181+
'visibility_required' => [
182+
'elements' => [
183+
'const',
184+
'method',
185+
'property',
186+
],
187+
],
188+
'void_return' => true,
189+
'whitespace_after_comma_in_array' => true,
190+
]
191+
)
192+
->setFinder(
193+
PhpCsFixer\Finder::create()
194+
->files()
195+
->in(__DIR__ . '/src')
196+
->in(__DIR__ . '/tests/tests')
197+
);

.travis.yml

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,60 @@
11
language: php
22

33
php:
4-
- 7.0
5-
- 7.1
6-
- nightly
7-
8-
sudo: false
4+
- 7.2
5+
- 7.3
6+
- 7.4snapshot
7+
8+
matrix:
9+
fast_finish: true
10+
11+
env:
12+
matrix:
13+
- DRIVER="xdebug" DEPENDENCIES="high"
14+
- DRIVER="phpdbg" DEPENDENCIES="high"
15+
- DRIVER="pcov" DEPENDENCIES="high"
16+
- DRIVER="xdebug" DEPENDENCIES="low"
17+
- DRIVER="phpdbg" DEPENDENCIES="low"
18+
- DRIVER="pcov" DEPENDENCIES="low"
19+
global:
20+
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest"
921

1022
before_install:
11-
- composer self-update
23+
- ./tools/composer clear-cache
1224

1325
install:
14-
- travis_retry composer install --no-interaction --prefer-source
26+
- if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry ./tools/composer update $DEFAULT_COMPOSER_FLAGS; fi
27+
- if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry ./tools/composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi
28+
29+
before_script:
30+
- |
31+
if [[ "$DRIVER" = 'pcov' ]]; then
32+
echo > $HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/xdebug.ini
33+
git clone --single-branch --branch=v1.0.6 --depth=1 https://github.com/krakjoe/pcov
34+
cd pcov
35+
phpize
36+
./configure
37+
make clean install
38+
echo "extension=pcov.so" > $HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/pcov.ini
39+
cd $TRAVIS_BUILD_DIR
40+
fi
1541
1642
script:
43+
- if [[ "$DRIVER" = 'phpdbg' ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
44+
- if [[ "$DRIVER" != 'phpdbg' ]]; then vendor/bin/phpunit --coverage-clover=coverage.xml; fi
1745

18-
- vendor/bin/phpunit --configuration build
46+
after_success:
47+
- bash <(curl -s https://codecov.io/bash)
1948

2049
notifications:
2150
email: false
2251

52+
jobs:
53+
include:
54+
- stage: Static Code Analysis
55+
php: 7.3
56+
env: php-cs-fixer
57+
install:
58+
- phpenv config-rm xdebug.ini
59+
script:
60+
- ./tools/php-cs-fixer fix --dry-run -v --show-progress=dots --diff-format=udiff

0 commit comments

Comments
 (0)