Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d62e66d

Browse files
Merge pull request #7 from Baby-Markt/feature/code-coverage
MASTER: Feature/code coverage
2 parents 926b0e2 + b8fcd32 commit d62e66d

File tree

3 files changed

+130
-2
lines changed

3 files changed

+130
-2
lines changed

.scrutinizer.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
filter:
2+
excluded_paths:
3+
- 'tests/*'
4+
- 'vendor/*'
5+
build:
6+
environment:
7+
php: 7.3.0
8+
nodes:
9+
analysis:
10+
project_setup:
11+
override: true
12+
tests:
13+
override:
14+
- php-scrutinizer-run
15+
- phpcs-run
16+
checks:
17+
php:
18+
verify_property_names: true
19+
verify_argument_usable_as_reference: true
20+
verify_access_scope_valid: true
21+
variable_existence: true
22+
useless_calls: true
23+
use_statement_alias_conflict: true
24+
unused_variables: true
25+
unused_properties: true
26+
unused_parameters: true
27+
unused_methods: true
28+
unreachable_code: true
29+
too_many_arguments: true
30+
symfony_request_injection: true
31+
switch_fallthrough_commented: true
32+
sql_injection_vulnerabilities: true
33+
security_vulnerabilities: true
34+
return_in_constructor: true
35+
require_scope_for_methods: true
36+
require_php_tag_first: true
37+
property_assignments: true
38+
precedence_mistakes: true
39+
precedence_in_conditions: true
40+
parse_doc_comments: true
41+
parameter_non_unique: true
42+
overriding_private_members: true
43+
overriding_parameter: true
44+
non_commented_empty_catch_block: true
45+
no_trait_type_hints: true
46+
no_trailing_whitespace: true
47+
no_short_open_tag: true
48+
no_property_on_interface: true
49+
no_non_implemented_abstract_methods: true
50+
no_exit: true
51+
no_eval: true
52+
no_error_suppression: true
53+
no_debug_code: true
54+
missing_arguments: true
55+
method_calls_on_non_object: true
56+
instanceof_class_exists: true
57+
foreach_usable_as_reference: true
58+
foreach_traversable: true
59+
fix_doc_comments: true
60+
encourage_shallow_comparison: true
61+
duplication: true
62+
deprecated_code_usage: true
63+
deadlock_detection_in_loops: true
64+
comparison_always_same_result: true
65+
code_rating: true
66+
closure_use_not_conflicting: true
67+
closure_use_modifiable: true
68+
catch_class_exists: true
69+
call_to_parent_method: true
70+
avoid_superglobals: true
71+
avoid_length_functions_in_loops: true
72+
avoid_entity_manager_injection: true
73+
avoid_duplicate_types: true
74+
avoid_closing_tag: true
75+
assignment_of_null_return: true
76+
argument_type_checks: true
77+
simplify_boolean_return: true
78+
return_doc_comments: true
79+
return_doc_comment_if_not_inferrable: true
80+
remove_extra_empty_lines: true
81+
properties_in_camelcaps: true
82+
phpunit_assertions: true
83+
parameters_in_camelcaps: true
84+
parameter_doc_comments: true
85+
param_doc_comment_if_not_inferrable: true
86+
no_short_variable_names:
87+
minimum: '3'
88+
no_short_method_names:
89+
minimum: '3'
90+
no_long_variable_names:
91+
maximum: '20'
92+
no_goto: true
93+
naming_conventions:
94+
local_variable: '^[a-z][a-zA-Z0-9]*$'
95+
abstract_class_name: ^Abstract|Factory$
96+
utility_class_name: 'Utils?$'
97+
constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$'
98+
property_name: '^[a-z][a-zA-Z0-9]*$'
99+
method_name: '^(?:[a-z]|__)[a-zA-Z0-9]*$'
100+
parameter_name: '^[a-z][a-zA-Z0-9]*$'
101+
interface_name: '^[A-Z][a-zA-Z0-9]*Interface$'
102+
type_name: '^[A-Z][a-zA-Z0-9]*$'
103+
exception_name: '^[A-Z][a-zA-Z0-9]*Exception$'
104+
isser_method_name: '^(?:is|has|should|may|supports)'
105+
more_specific_types_in_doc_comments: true
106+
fix_use_statements:
107+
remove_unused: true
108+
preserve_multiple: false
109+
preserve_blanklines: false
110+
order_alphabetically: false
111+
fix_line_ending: true
112+
check_method_contracts:
113+
verify_interface_like_constraints: true
114+
verify_documented_constraints: true
115+
verify_parent_constraints: true
116+
coding_style:
117+
php: { }
118+
before_commands:
119+
- 'composer install --dev --prefer-source'
120+
tools:
121+
external_code_coverage: true

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ cache:
2626
- $HOME/.composer/cache
2727

2828
before_install:
29-
- phpenv config-rm xdebug.ini
3029
- composer validate
3130

3231
install:
3332
- composer install
3433

3534
script:
36-
- composer test:all
35+
- composer test:all
36+
37+
after_script:
38+
- wget https://scrutinizer-ci.com/ocular.phar
39+
- php ocular.phar code-coverage:upload --format=php-clover build/clover.xml

phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212
<directory suffix=".php">src/</directory>
1313
</whitelist>
1414
</filter>
15+
16+
<logging>
17+
<log type="coverage-clover" target="build/clover.xml" />
18+
</logging>
1519
</phpunit>

0 commit comments

Comments
 (0)