Problem/Motivation
Symfony string inflector is buggy...
Several examples:
use Symfony\Component\String\Inflector\EnglishInflector;
$inflector = new EnglishInflector();
$inflector->pluralize('coupon'); // This returns "coupa".
$inflector->pluralize('coupons'); // This will return "couponss".
I tried the same with the Doctrine inflector, which we stopped using as part of #3117772: Doctrine\Common\Inflector\Inflector no longer in D9 and I got the expected results (i.e "coupons") for both strings).
My proposal is to switch back to using the Doctrine inflector, and require that directly.
The main issue this is causing is the promotion--coupons relationship that's being renamed to "promotion-coupa"...
Comments
Comment #2
jsacksick commentedDoctrine Inflector has a 2.x branch, which requires php 7.2 at least. I'm not sure we can actually require the 1.x branch as it could potentially create conflicts with other dependencies...
Comment #3
jsacksick commentedComment #4
jsacksick commentedComment #5
jsacksick commentedWondering if we shouldn't come up with our own inflector logic... as we don't need fancyness and simply need to append a "s" for commerce entity types and don't really need to care about english pluralization.
Comment #6
jsacksick commentedTo avoid potential version conflicts with different versions of core, I decided to try out a different library, let's see if the tests pass!
Comment #7
jsacksick commentedComment #8
jsacksick commentedComment #9
jsacksick commentedCoding standard fixes.
Comment #11
jsacksick commentedCommited.