TopShelfCraft / Wordsmith

A plugin for Craft CMS to help you manage and manipulate text.
Other
30 stars 20 forks source link

Update icanboogie/inflector to 2.0 for PHP 7.4 support #34

Closed Kashkin closed 2 years ago

Kashkin commented 4 years ago

Currently the |pluralize filter wont work in PHP 7.4, as inflector through version 1.5.0 uses the deprecated array and string offset access syntax with curly braces.

e.g.

$r0 = $rule{0};

Which in 2.0.0 is now:

$r0 = $rule[0];

I haven't tested to see if 2.0.0 causes any other issues, but it was released in October 2019, so is presumably pretty safe by now.

This will throw an internal server error on any page using the filter, so I would see it as a high priority to address.

Cheers.

michaelrog commented 4 years ago

Thanks for the heads-up, @Kashkin. We'll need to make sure to code around any breaking changes in 2.0, but I'm in favor of updating. Would you like to check it out and submit a PR to 3.x.dev?

tremby commented 2 years ago

I just ran into this issue.

The inflector v2.0.0 changelog https://github.com/ICanBoogie/Inflector/releases/tag/v2.0.0 says it's only dropping support for old versions of PHP and there are no other breaking changes.

I don't know if the changes in v2.1.0 are breaking; it mentions that some things are classes which were not in the past.

But I tried dropping the latest version in, replacing 1.5.0 in my vendor directory. After composer dump-autoload everything seems to be working just fine.