timkelty / craftcms-site-sync

Sync content to locales on element save.
MIT License
40 stars 9 forks source link

This plugin requires at least PHP 7.1 due to nullable types #18

Closed rob-c-baker closed 5 years ago

rob-c-baker commented 5 years ago

I happen to have PHP 7.0.x on my server (I know... It needs updating and I will soon!).

I installed this plugin and got a PHP error:

ParseError syntax error, unexpected '?' in /[**REMOVED**]/vendor/timkelty/craftcms-site-sync/src/models/Syncable.php at line 58

This is the line:

private static function findFieldData(Element $element): ?Syncable

It uses a nullable type, which arrived in PHP 7.1.

My suggestion is to update the composer.json for this plugin to add something like:

"php": ">=7.1.0"

... to the "require" section.

timkelty commented 5 years ago

Thanks @rob-baker-ar! Indeed it should be 7.1. Updating now.

timkelty commented 5 years ago

Released in https://github.com/timkelty/craftcms-site-sync/tree/1.0.1