Skip to content

Overrides the file with some log output? #5

@muuvmuuv

Description

@muuvmuuv

normal .php files are working fine, but when I select a plain text as php template and run the formatter this weird thing happen:

Before:

<?php

return PhpCsFixer\Config::create()
  ->setRiskyAllowed(true)
  ->setIndent('  ')
  ->setLineEnding("\n")
  ->setRules([
    '@Symfony' => true,
    'indentation_type' => true,
    'array_indentation' => true,
    // 'array_syntax' => ['syntax' => 'short'],
    'dir_constant' => true,
    'heredoc_to_nowdoc' => true,
    'linebreak_after_opening_tag' => true,
    'modernize_types_casting' => true,
    'semicolon_after_instruction' => true,
    'align_multiline_comment' => true,
    'doctrine_annotation_array_assignment' => true,
    'general_phpdoc_annotation_remove' => true,
    'list_syntax' => true,
    'single_line_comment_style' => true,
    'combine_consecutive_unsets' => true,
    'method_separation' => true,
    'no_multiline_whitespace_before_semicolons' => true,
    'single_quote' => true,
    'concat_space' => ['spacing' => 'one'],
    'phpdoc_align' => true,
    'phpdoc_annotation_without_dot' => true,
    'phpdoc_indent' => true,
    'phpdoc_inline_tag' => true,

    'binary_operator_spaces' => [
      'align_double_arrow' => false,
      'align_equals' => false,
    ],
    'braces' => [
      'allow_single_line_closure' => true,
    ],
    'declare_equal_normalize' => true,
    'function_typehint_space' => true,
    'hash_to_slash_comment' => true,
    'include' => true,
    'lowercase_cast' => true,
    'no_extra_consecutive_blank_lines' => [
      'curly_brace_block',
      'extra',
      'parenthesis_brace_block',
      'square_brace_block',
      'throw',
      'use',
    ],
    'single_blank_line_before_namespace' => true,
    'ternary_operator_spaces' => true,
    'trim_array_spaces' => true,
    'unary_operator_spaces' => true,
    'whitespace_after_comma_in_array' => true,

    'no_multiline_whitespace_before_semicolons' => true,
    'no_unreachable_default_argument_value' => true,
    'no_useless_else' => true,
    'no_useless_return' => true,
    'no_php4_constructor' => true,
    'no_short_echo_tag' => true,

    'ordered_class_elements' => true,
    'ordered_imports' => true,

    'phpdoc_add_missing_param_annotation' => true,
    'phpdoc_order' => true,
    'phpdoc_types_order' => true,

    'doctrine_annotation_braces' => true,
    'doctrine_annotation_indentation' => true,
    'doctrine_annotation_spaces' => true,
  ]);

After:

No fixable errors were found

Time: 34ms; Memory: 4Mb

So it outputs some log into the file and removes everything

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions