Issues (4)

phpstyle.php (2 issues)

Labels
Severity
1
<?php
2
3
// Specify the paths in this variable ---
4
$paths = array(__DIR__ . '/src');
5
6
$paths[] = __DIR__ . '/tests';
7
// --------------------------------------
8
9
// Specify the rules for code formatting ---------
10
$rules = array('@PSR12' => true);
11
12
$cscp = 'control_structure_continuation_position';
13
$rules[$cscp] = ['position' => 'next_line'];
14
15
$braces = array();
16
$braces['control_structures_opening_brace'] = 'next_line_unless_newline_at_signature_end';
17
$braces['functions_opening_brace'] = 'next_line_unless_newline_at_signature_end';
18
$braces['anonymous_functions_opening_brace'] = 'next_line_unless_newline_at_signature_end';
19
$braces['anonymous_classes_opening_brace'] = 'next_line_unless_newline_at_signature_end';
20
$braces['allow_single_line_empty_anonymous_classes'] = false;
21
$braces['allow_single_line_anonymous_functions'] = false;
22
$rules['braces_position'] = $braces;
23
24
$visibility = array('elements' => array());
25
$visibility['elements'] = array('method', 'property');
26
$rules['visibility_required'] = $visibility;
27
28
$rules['phpdoc_var_annotation_correct_order'] = true;
29
30
$rules['single_quote'] = ['strings_containing_single_quote_chars' => true];
31
32
$rules['no_unused_imports'] = true;
33
34
$rules['align_multiline_comment'] = true;
35
36
$rules['trim_array_spaces'] = true;
37
38
$order = ['case_sensitive' => true];
39
$order['null_adjustment'] = 'always_last';
40
$rules['phpdoc_types_order'] = $order;
41
42
$rules['new_with_parentheses'] = ['named_class' => false];
43
44
$rules['concat_space'] = ['spacing' => 'one'];
45
46
$rules['no_empty_phpdoc'] = true;
47
48
$groups = [];
49
$groups[] = ['template', 'extends'];
50
$groups[] = ['deprecated', 'link', 'see', 'since', 'codeCoverageIgnore'];
51
$groups[] = ['property', 'property-read', 'property-write'];
52
$groups[] = ['method'];
53
$groups[] = ['author', 'copyright', 'license'];
54
$groups[] = ['category', 'package', 'subpackage'];
55
$groups[] = ['param'];
56
$groups[] = ['return', 'throws'];
57
$rules['phpdoc_separation'] = ['groups' => $groups];
58
59
$align = ['align' => 'vertical'];
60
$align['tags'] = ['method', 'param', 'property', 'throws', 'type', 'var'];
61
$rules['phpdoc_align'] = $align;
62
63
$rules['statement_indentation'] = false;
64
65
$rules['align_multiline_comment'] = true;
66
// -----------------------------------------------
67
68
$finder = new \PhpCsFixer\Finder;
0 ignored issues
show
The type PhpCsFixer\Finder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
69
70
$finder->in((array) $paths);
71
72
$config = new \PhpCsFixer\Config;
0 ignored issues
show
The type PhpCsFixer\Config was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
73
74
$config->setRules($rules);
75
76
return $config->setFinder($finder);
77