Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How with pint can I remove space after negative “!” symbol?

How with laravel/pint 1.4 can I remove space after negative “!” symbol ?

Not :

if (! self::$wasSetup) {

But :

if (!self::$wasSetup) {

I suppose that last is psr-12 rule...

Thanks!

like image 796
mstdmstd Avatar asked Oct 15 '25 04:10

mstdmstd


1 Answers

As per PHP-CS-Fixer , Rule not_operator_with_successor_space

Logical NOT operators (!) should have one trailing whitespace.

So by default, one trailing whitespace is enabled. To disable white space after NOT operators then you should create a pint.json file in the root folder

{
    "preset": "laravel",
    "rules": {
        "not_operator_with_successor_space": false
    }
}

enter image description here

like image 179
John Lobo Avatar answered Oct 18 '25 02:10

John Lobo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!