Skip to content

[6.0] Replace all joomla/string inflector code#45040

Merged
softforge merged 9 commits intojoomla:6.0-devfrom
Hackwar:6.0-doctrine-inflector
Aug 11, 2025
Merged

[6.0] Replace all joomla/string inflector code#45040
softforge merged 9 commits intojoomla:6.0-devfrom
Hackwar:6.0-doctrine-inflector

Conversation

@Hackwar
Copy link
Member

@Hackwar Hackwar commented Feb 28, 2025

Summary of Changes

The doctrine/inflector package is currently stuck on version 1.4.4, which right now is 4 years old. The current version 2.0.10 is mostly compatible - except for the Doctrine\Common\Inflector\Inflector class, which was deprecated and removed in 2.0. Unfortunately that class is the basis for the joomla/string packages inflector class. Since that base class is deprecated, this code removes all usages of the Joomla inflector package from our core code and instead uses the Doctrine package directly. The next step would be to update the package to the latest version, but that would break our joomla/string package, at least in our current situation. Fixing the string package to work with the newer code is left for someone else to work on...

The improvement here is, that it removes the usage of deprecated code and makes phpstan happy.

Testing Instructions

  • Visit a category/tags/workflow list view in the backend.
  • Via the REST API,
    • submit a form to com_contact
    • create an override for a language string in com_language
    • save and delete a media item in com_media
    • edit a plugin in com_plugins
    • save a template style in com_templates

In each case it should all behave like before.

Or alternatively do a codereview.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Copy link
Contributor

@voronkovich voronkovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we define an inflector as a service? If Joomla has a DI container, why don't we use it?

@Hackwar
Copy link
Member Author

Hackwar commented Mar 1, 2025

Be my guest. Right now I'm just going to unify the code to use the same stuff everywhere.

@brianteeman
Copy link
Contributor

Not really sure what/how to test here as the test instructions are VERY incomplete

but after reading the code in administrator\components\com_tags\tmpl\tags\default.php I did some tests to ensure that the value of $section is the same before and after the PR

@softforge softforge added this to the Joomla! 6.0.0 milestone Aug 11, 2025
@softforge softforge merged commit d5aa1ca into joomla:6.0-dev Aug 11, 2025
30 checks passed
@softforge
Copy link
Contributor

Thank you for the work on this, the code reviews and help going through this.

@Hackwar Hackwar deleted the 6.0-doctrine-inflector branch August 13, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants

Comments