Skip to content

[BUG] Impossible to disable cast_spaces rule #397

@vkarchevskyi

Description

@vkarchevskyi

Pint Version

1.24.0

PHP Version

8.4

Description

Configuration property cast_spaces doesn't affect on lint results.

Steps To Reproduce

  1. Create new Laravel project
  2. Insert the following configuration in pint.json file
{
    "preset": "per",
    "rules": {
        "array_push": true,
        "backtick_to_shell_exec": true,
        "cast_spaces": true,
        "date_time_immutable": true,
        "declare_strict_types": true,
        "lowercase_keywords": true,
        "lowercase_static_reference": true,
        "fully_qualified_strict_types": true,
        "global_namespace_import": {
            "import_classes": true,
            "import_constants": true,
            "import_functions": true
        },
        "mb_str_functions": true,
        "modernize_types_casting": true,
        "new_with_parentheses": true,
        "no_superfluous_elseif": true,
        "no_useless_else": true,
        "no_multiple_statements_per_line": true,
        "ordered_interfaces": true,
        "ordered_traits": true,
        "strict_comparison": true,
        "visibility_required": true
    }
}
  1. Write a statement with cast and run pint.
$body = (string)$response->getBody();
  1. Check that it was fixed.
  2. Change cast_spaces to false.
  3. Run pint again and see, that nothing was changed, but it should according to none configuration property of PHP-CS-Fixer.

https://cs.symfony.com/doc/rules/cast_notation/cast_spaces.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions