jacovanc / php-auto-strict-types

VSCode extension to automatically add strict types declaration to PHP files on save.
https://marketplace.visualstudio.com/items?itemName=jacovanc.php-auto-strict-types
Apache License 2.0
2 stars 1 forks source link

Not PSR12 Compliant #2

Open tomchkk opened 2 weeks ago

tomchkk commented 2 weeks ago

Hi, thanks for this extension. I've been using it for a couple of months and it's simple and does what it says on the tin.

My only issue is that the declaration when added immediately after the opening php tag is not PSR12 compliant - i.e:

// not PSR12 compliant ❌ 
<?php declare(strict_types=1);
// PSR12 compliant ✅ 
<?php

declare(strict_types=1);

I can create a pull request with the most simple update to fix this, but considering you created the package this way, it may be your preference, so you might like to handle it as a setting. I don't know how to do that and don't have the time to figure it out atm 😞

jacovanc commented 2 weeks ago

Hi Tom,

Go for it! I have no preference there, didn't realise it wasn't compliant. I don't think there's any need for a setting.

Cheers!