Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctrine/inflector deprecation is breaking change (plural of 'equipment') #5957

Closed
acirulis opened this issue Nov 9, 2023 · 7 comments
Closed

Comments

@acirulis
Copy link
Contributor

acirulis commented Nov 9, 2023

API Platform version(s) affected: 3.2.4

Description
There is a deprecation:

Using doctrine/inflector is deprecated since API Platform 3.2 and will be removed in API Platform 4. Use symfony/string instead. Run "composer require symfony/string" and set "keep_legacy_inflector" to false in config.

After implementing it, some routes will change.

Specific example:

Before:
/api/equipment
After
/api/equipments

According to https://www.britannica.com/dictionary/eb/qa/equipments-equipment-noncount-mass-noun-singular-plural
correct plural form of equipment is equipment. It also feels natural but I am not a native speaker.

Should I submit this as issue for symfony/string? Or there are other considerations? Thanks!

@paullallier
Copy link
Contributor

Equipment as the plural would definitely be grammatically correct.

@paullallier
Copy link
Contributor

@acirulis: I've spotted a few other issues in the symfony/string inflector too so I'm going to raise a PR - hope you don't mind.

paullallier added a commit to paullallier/symfony that referenced this issue Nov 9, 2023
@acirulis spotted that equipment was missing here: api-platform/core#5957

I've added that and a few more non-countable nouns that I think are reasonably likely to be used by someone.  Arguably, time and work could also be here since they are normally non-countable, but there cases where times and works would be correct too.
@simpletoimplement
Copy link

is it possible in api-platform to use my own inflector?
adding new rules to string is a possible solution, but string has an inflector interface. maybe something like use "this" inflector if "that" inflector does not have rule for needed words?

@dunglas
Copy link
Member

dunglas commented Nov 14, 2023

@simpletoimplement yes, just implement the interface provided by Symfony.

Closing as a PR is opened on SF and it's technically not a BC break (by default, the old library is used and a manual action must be done to switch).

@dunglas dunglas closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2023
fabpot added a commit to symfony/symfony that referenced this issue Nov 18, 2023
This PR was squashed before being merged into the 5.4 branch.

Discussion
----------

Add some more non-countable English nouns

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | N/A
| License       | MIT

`@acirulis` spotted that equipment was missing here: api-platform/core#5957

I've added that and a few more non-countable nouns that I think are reasonably likely to be used by someone.  Arguably, time and work could also be here since they are normally non-countable, but there cases where times and works would be correct too.

And I corrected vocal to vowel, which is the correct English term

I'm not sure if this needs extra tests - happy to add if needed.

Commits
-------

cd6a28c Add some more non-countable English nouns
@paullallier
Copy link
Contributor

@acirulis FYI, this fix is in Symfony 5.4.32 and 6.3.9.

@acirulis
Copy link
Contributor Author

Thanks, already updated.

@acirulis
Copy link
Contributor Author

Oh, now I got plural "settingss" out of "settings" - should I open new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants