Global Config
#language: php
filter:
excluded_paths:
- 'tests/*'
- 'bin/*'
checks:
php:
code_rating: true
custom_coding_standard:
git_repository: 'https://github.com/legalthings/php-code-quality.git'
ruleset_path: 'ruleset.xml'
uppercase_constants: true
simplify_boolean_return: true
return_doc_comment_if_not_inferrable: true
param_doc_comment_if_not_inferrable: true
optional_parameters_at_the_end: true
no_goto: true
more_specific_types_in_doc_comments: true
line_length:
max_length: '120'
classes_in_camel_caps: true
avoid_perl_style_comments: true
align_assignments: false
one_class_per_file: false # Is PSR1 namespace check
coding_style:
php:
spaces:
other:
after_type_cast: false
braces:
classes_functions:
class: new-line
function: new-line
closure: end-of-line
if:
opening: end-of-line
always: false
for:
opening: end-of-line
while:
opening: end-of-line
do_while:
opening: end-of-line
switch:
opening: end-of-line
try:
opening: end-of-line
upper_lower_casing:
keywords:
general: lower
constants:
true_false_null: lower
build_failure_conditions:
- 'elements.rating(<= D).exists' # No classes/methods with a rating of D or worse
- 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity
- 'project.metric_change("scrutinizer.quality", < -0.3)' # Code quality drops more than 3%
- 'project.metric_change("scrutinizer.test_coverage", < -0.02)' # Code coverage drops more than 2%
tools:
external_code_coverage: true