laravel/pint

Weird bugs when having set binary_operator_spaces: align_single_space_minimal

CamilleScholtz opened this issue · 2 comments

Pint Version

1.13.9

PHP Version

8.2.14

Description

This bug happens since 1.13.9, not in 1.13.8. When having the binary_operator_spaces set to align_single_space_minimal all kinds of paths and strings get destroyed by spaces in places where they should be, some example:

'postal-code'  => ['required',  'regex:/^[0-9]{4} ?[a-zA-Z]{2}$/'],
// becomes
'postal-code'  => ['required',  'regex:/^[0-9]{4} ?[a- zA- Z]{2}$/'],
            
'edit'   => Pages\EditArticle::route('/{record}/edit'),
// becomes
'edit'   => Pages\EditArticle::route('/{record} /edit'),

The config:

{
    "preset": "laravel",
    "rules": {
        "no_useless_else": true,
        "binary_operator_spaces": {
            "default": "align_single_space_minimal"
        }
    }
}

Steps To Reproduce

Set the config file as shown above and run laravel pint.

Is already fixed, will probably be released on Tuesday.