monsieurbiz / SyliusSettingsPlugin

Provide some custom settings to your favorite Sylius shop!
MIT License
23 stars 18 forks source link

[PHP] Compatibility with php 7.3 #4

Closed oallain closed 3 years ago

oallain commented 4 years ago

Hello,

Thank you for this great plugin which will surely help all the developers who work with Sylius. :rocket:

I see in composer.json "php": "~7.4", do you think we can make this plugin PHP 7.3 compatible?

Thanks !

jacquesbh commented 4 years ago

Hi @oallain!

I'm sorry but I won't make that happened. I still prefer to go forward and using PHP 7.4 helps to avoid a lot of bugs, by using strict types mostly.

But if you want to give it a try in your own branch, here are all the (first) syntax issues with PHP 7.3:

Parse error: syntax error, unexpected 'SettingsProcessorInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Controller/SettingsController.php on line 26

Parse error: syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST) in src/Entity/Setting/Setting.php on line 30

Parse error: syntax error, unexpected 'FormFactoryInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Factory/Form/MainSettingsFormTypeFactory.php on line 22

Parse error: syntax error, unexpected 'ChannelRepositoryInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Form/MainSettingsType.php on line 25

Parse error: syntax error, unexpected 'MenuManipulator' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Menu/AdminMenuListener.php on line 16

Parse error: syntax error, unexpected 'FactoryInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Menu/SettingsFormMenuBuilder.php on line 19

Parse error: syntax error, unexpected 'ChannelRepositoryInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Processor/SettingsProcessor.php on line 25

Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST) in src/Settings/Metadata/Registry.php on line 24

Parse error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Settings/Metadata.php on line 12

Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST) in src/Settings/Registry.php on line 15

Parse error: syntax error, unexpected 'Metadata' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Settings/Settings.php on line 22

Parse error: syntax error, unexpected 'RegistryInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in src/Twig/Extension/SettingsExtension.php on line 21

I let this issue opened in case you take it. I won't merge a PR but I would be OK to give a link in the README to get a version compatible with PHP 7.3. Does it sound ok to you?

oallain commented 3 years ago

Hi @jacquesbh ,

I share your perspective on moving forward. Not supporting backwards compatibility with PHP 7.3 is your choice, which I respect.

Therefore, I will work to migrate projects that are not yet in PHP 7.4 :rocket:

Thanks

jacquesbh commented 3 years ago

Thank you Olivier!