Skip to content

Commit

Permalink
Merge pull request #49 from mvorisek/fix_cs
Browse files Browse the repository at this point in the history
Improve and assert CS
  • Loading branch information
alecpl authored Apr 11, 2024
2 parents 2f8d52e + 5f368a7 commit 95d50ca
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 226 deletions.
37 changes: 1 addition & 36 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,43 +58,8 @@
// also prevent bounding of unwanted variables for GC
'use_arrow_functions' => false,

// TODO
'align_multiline_comment' => false,
'array_indentation' => false,
'binary_operator_spaces' => false,
'blank_line_after_opening_tag' => false,
'blank_line_before_statement' => false,
'concat_space' => false,
'control_structure_continuation_position' => false,
// disable too destructive formating for now
'declare_strict_types' => false,
'explicit_string_variable' => false,
'function_declaration' => false,
'function_to_constant' => false,
'general_phpdoc_annotation_remove' => false,
'include' => false,
'list_syntax' => false,
'method_argument_space' => false,
'native_constant_invocation' => false,
'new_with_parentheses' => false,
'no_alias_functions' => false,
'no_empty_phpdoc' => false,
'no_spaces_after_function_name' => false,
'no_superfluous_phpdoc_tags' => false,
'ordered_imports' => false,
'phpdoc_indent' => false,
'phpdoc_no_alias_tag' => false,
'phpdoc_no_package' => false,
'phpdoc_separation' => false,
'phpdoc_summary' => false,
'single_line_empty_body' => false,
'single_quote' => false,
'single_space_around_construct' => false,
'spaces_inside_parentheses' => false,
'static_lambda' => false,
'strict_comparison' => false,
'strict_param' => false,
'string_implicit_backslashes' => false,
'yoda_style' => false,
])
->setFinder($finder)
->setCacheFile(sys_get_temp_dir() . '/php-cs-fixer.' . md5(__DIR__) . '.cache');
28 changes: 1 addition & 27 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,8 @@ parameters:
# relax strict rules
- '~^Only booleans are allowed in .+, .+ given( on the (left|right) side)?\.~'
- '~^Construct empty\(\) is not allowed\. Use more strict comparison\.~'
- '~^Loose comparison via "[=!]=" is not allowed\.~'

# TODO
-
message: '~^Anonymous function uses \$this assigned to variable \$self. Use \$this directly in the function body\.$~'
path: 'src/ExtensionInstaller.php'
count: 3

-
message: '~^Constant RCMAIL_VERSION not found\.$~'
path: 'src/ExtensionInstaller.php'
count: 3
-
message: '~^Method Roundcube\\Composer\\ExtensionInstaller::install\(\) should return React\\Promise\\PromiseInterface<void\|null>|null but return statement is missing\.$~'
path: 'src/ExtensionInstaller.php'
count: 3
-
message: '~^Undefined variable: \$rootdir$~'
path: 'src/ExtensionInstaller.php'
count: 1
-
message: '~^Short ternary operator is not allowed\. Use null coalesce operator if applicable or consider using long ternary\.$~'
path: 'src/ExtensionInstaller.php'
count: 1
-
message: '~^Call to function in_array\(\) requires parameter #3 to be set\.$~'
path: 'src/PluginInstaller.php'
count: 1
-
message: '~^Call to function array_search\(\) requires parameter #3 to be set\.$~'
path: 'src/PluginInstaller.php'
count: 1
Loading

0 comments on commit 95d50ca

Please sign in to comment.