1 | <?php |
||
2 | |||
3 | use PhpCsFixer\Config; |
||
0 ignored issues
–
show
This use statement conflicts with another class in this namespace,
Config . Consider defining an alias.
Let?s assume that you have a directory layout like this: .
|-- OtherDir
| |-- Bar.php
| `-- Foo.php
`-- SomeDir
`-- Foo.php
and let?s assume the following content of // Bar.php
namespace OtherDir;
use SomeDir\Foo; // This now conflicts the class OtherDir\Foo
If both files PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as // Bar.php
namespace OtherDir;
use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
![]() |
|||
4 | use 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
5 | |||
6 | $finder = Finder::create()->in(__DIR__)->exclude('resources'); |
||
7 | |||
8 | $rules = [ |
||
9 | 'array_syntax' => ['syntax' => 'short'], |
||
10 | 'binary_operator_spaces' => true, |
||
11 | 'blank_line_after_namespace' => true, |
||
12 | 'blank_line_after_opening_tag' => true, |
||
13 | 'blank_line_before_statement' => ['statements' => ['return']], |
||
14 | 'braces' => true, |
||
15 | 'cast_spaces' => true, |
||
16 | 'concat_space' => ['spacing' => 'none'], |
||
17 | 'constant_case' => ['case' => 'lower'], |
||
18 | // 'echo_tag_syntax' => ['format' => 'long'], |
||
19 | 'elseif' => true, |
||
20 | 'encoding' => true, |
||
21 | 'full_opening_tag' => true, |
||
22 | 'function_declaration' => true, |
||
23 | 'include' => true, |
||
24 | 'indentation_type' => true, |
||
25 | 'line_ending' => true, |
||
26 | 'lowercase_keywords' => true, |
||
27 | 'method_argument_space' => true, |
||
28 | 'multiline_whitespace_before_semicolons' => true, |
||
29 | 'no_alias_functions' => true, |
||
30 | 'no_blank_lines_after_class_opening' => true, |
||
31 | 'no_blank_lines_after_phpdoc' => true, |
||
32 | 'no_empty_statement' => true, |
||
33 | 'no_extra_blank_lines' => ['tokens' => ['extra']], |
||
34 | 'no_leading_import_slash' => true, |
||
35 | 'no_leading_namespace_whitespace' => true, |
||
36 | 'no_multiline_whitespace_around_double_arrow' => true, |
||
37 | 'no_short_bool_cast' => true, |
||
38 | 'no_singleline_whitespace_before_semicolons' => true, |
||
39 | 'no_spaces_after_function_name' => true, |
||
40 | 'no_spaces_inside_parenthesis' => true, |
||
41 | 'no_trailing_comma_in_list_call' => true, |
||
42 | 'no_trailing_comma_in_singleline_array' => true, |
||
43 | 'no_trailing_whitespace' => true, |
||
44 | 'no_unused_imports' => true, |
||
45 | 'no_whitespace_in_blank_line' => true, |
||
46 | 'not_operator_with_successor_space' => true, |
||
47 | 'object_operator_without_whitespace' => true, |
||
48 | 'ordered_imports' => ['sort_algorithm' => 'alpha'], |
||
49 | 'phpdoc_indent' => true, |
||
50 | 'phpdoc_no_access' => true, |
||
51 | // 'phpdoc_no_alias_tag' => ['type' => 'var'], |
||
52 | 'phpdoc_no_package' => true, |
||
53 | 'phpdoc_scalar' => true, |
||
54 | 'phpdoc_summary' => true, |
||
55 | 'phpdoc_to_comment' => true, |
||
56 | 'phpdoc_trim' => true, |
||
57 | 'phpdoc_var_without_name' => true, |
||
58 | 'self_accessor' => true, |
||
59 | 'simplified_null_return' => true, |
||
60 | 'single_blank_line_at_eof' => true, |
||
61 | 'single_blank_line_before_namespace' => true, |
||
62 | 'single_import_per_statement' => true, |
||
63 | 'single_line_after_imports' => true, |
||
64 | 'single_quote' => true, |
||
65 | 'standardize_not_equals' => true, |
||
66 | 'ternary_operator_spaces' => true, |
||
67 | 'trailing_comma_in_multiline' => ['elements' => ['arrays']], |
||
68 | 'trim_array_spaces' => true, |
||
69 | 'unary_operator_spaces' => true, |
||
70 | 'visibility_required' => ['elements' => ['property', 'method'/*, 'const'*/]], |
||
71 | ]; |
||
72 | |||
73 | $config = new Config(); |
||
74 | |||
75 | return $config |
||
76 | ->setFinder($finder) |
||
77 | ->setRules($rules) |
||
78 | ->setRiskyAllowed(true) |
||
79 | ->setUsingCache(true); |
||
80 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths