FOSUserBundle icon indicating copy to clipboard operation
FOSUserBundle copied to clipboard

Use php short syntax array in new fosuser bundle versions

Open shakaran opened this issue 7 years ago • 3 comments

Regarding to this commit: https://github.com/FriendsOfSymfony/FOSUserBundle/commit/14ca4fb6e08e008d4deb773990bc81343c7cb04f

Symfony 3.4 and 4.0 will require 7.1.3 at least

https://github.com/symfony/symfony/blob/3.3/composer.json

Symfony 3.3 => ^5.5.9|>=7.0.8

https://github.com/symfony/symfony/blob/3.2/composer.json

Symfony 3.2 => >=5.5.9

https://github.com/symfony/symfony/blob/3.1/composer.json

Symfony 3.1 => >=5.5.9

https://github.com/symfony/symfony/blob/3.0/composer.json

Symfony 3.0 => >=5.5.9

https://github.com/symfony/symfony/blob/2.8/composer.json

Symfony 2.8 => >=5.3.9

As you can see only Symfony 2.8 needs php long syntax array. So I am purposing that new versions of fosuser bundle will require at least 5.4 or upper (ideal will be 7.0).

That is for new master or could be fosuser 2.1 or 2.2 will use only php short syntax array.

This could be easily achieved using PHP-CS-Fixer (I could make a PR for all this if you want). Doing this will not break compatibility for old users (and users could choose if use 2.0 or 2.1 or 2.2 for new PHP) and you will leverage the new php features and helping to the users to use new php version

shakaran avatar Aug 03 '17 18:08 shakaran

Symfony 2.7 and Symfony 2.8 (bugfix support ends 2018) are LTS versions that both support PHP 5.3. IMO it's not worth to maintain two versions of FOSUserBundle just for the sake of being able to use the short array syntax.

xabbuh avatar Aug 03 '17 18:08 xabbuh

@xabbuh not only by the short array syntax, but yes to start using other new features. Also even if it is supported by Symfony, PHP 5.3 is EOL (you also could argue until 2019 which has end support for security fixes, which would be horrible wait still 2 years more to use new things).

Desn't make sense slow down the progress when your language is not supporting even that PHP version.

I purpose that you leave for example 2.0 as security maintenance only or so for keep the Symfony LTS user's happy, and move forward with new 2.1 or 2.2 or 3.0 (call it as you want it, but the new master) and start to use the new things in PHP. Not only for the syntax, also strong typing or so.

Moving a lot bundles to new PHP version will improve the PHP 7.X adoption more quickly. If a lot maintaners still keep 5.3 support for years, we never could have nice things in web.

shakaran avatar Aug 03 '17 22:08 shakaran

Since 49e3117888f8ed79a10afe5f0cb7a404c13b616c fos user bundle supports PHP 5.5.9+. So there is no need to maintain multiple versions for it.

Tomsgu avatar Jan 08 '18 15:01 Tomsgu