PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar janschoenherr
janschoenherr
5 Dec 2024

Summary of Changes

  • Remove unnecessary type casts
  • Simplify boolean expressions
  • Unwrap sprintf() calls with single argument
  • Replace switch statements with single branch with if statements
  • Use str_*() functions
  • Replace calls like dirname(__FILE__) with __DIR__

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

avatar janschoenherr janschoenherr - open - 5 Dec 2024
avatar janschoenherr janschoenherr - change - 5 Dec 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Dec 2024
Category Administration com_associations com_categories com_config com_content com_fields com_finder com_installer com_joomlaupdate com_menus com_modules com_redirect com_tags
avatar janschoenherr janschoenherr - change - 5 Dec 2024
Labels Added: PR-5.3-dev
avatar janschoenherr janschoenherr - change - 5 Dec 2024
The description was changed
avatar janschoenherr janschoenherr - edited - 5 Dec 2024
avatar janschoenherr janschoenherr - change - 5 Dec 2024
The description was changed
avatar janschoenherr janschoenherr - edited - 5 Dec 2024
avatar laoneo
laoneo - comment - 17 Jan 2025

Did you do that manually or by a code analyzer tool like rector PHP?

avatar joomla-cms-bot joomla-cms-bot - change - 17 Jan 2025
Category Administration com_associations com_categories com_config com_content com_fields com_finder com_installer com_joomlaupdate com_menus com_modules com_redirect com_tags Administration com_associations com_banners com_categories com_config com_contact com_content com_cpanel com_fields com_finder com_installer
avatar janschoenherr
janschoenherr - comment - 17 Jan 2025

Did you do that manually or by a code analyzer tool like rector PHP?

I did that mostly using PhpStorm.

avatar joomdonation
joomdonation - comment - 11 Feb 2025

Thanks for your hard work on this PR. But I think make changes to many files like this in a single PR will make it hard for us to review the change to make sure it is correct

If it is possible, I would suggest you to split the PR into smaller PRs, each PR for a single rule like Remove unnecessary type casts in one PR, Simplify boolean expressions in another PR and so on. For Use str_*() functions, if you have experience with rector, I would suggest you to use that tool to do the change instead of doing it manually by hand.

avatar janschoenherr janschoenherr - change - 13 Feb 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-02-13 09:04:47
Closed_By janschoenherr
avatar janschoenherr janschoenherr - close - 13 Feb 2025
avatar janschoenherr
janschoenherr - comment - 13 Feb 2025

For Use str_*() functions, if you have experience with rector, I would suggest you to use that tool to do the change instead of doing it manually by hand.

I should have phrased that differently above. PhpStorm does that for us :-)

I will close this and separate it into separate PRs.

avatar joomdonation
joomdonation - comment - 13 Feb 2025

I should have phrased that differently above. PhpStorm does that for us :-)

Guess you should still look at the code in each file, then scan for needed change (Yes, PHPStorm will show it to us), and apply the change one by one? Doing the task using rector is much faster :). I made several PRs for that already, so you do not need to make PRs for str_*() functions anymore.

I will close this and separate it into separate PRs.

Great. I will review your PRs and mark my test result to have it merged :)

avatar janschoenherr
janschoenherr - comment - 13 Feb 2025

Guess you should still look at the code in each file, then scan for needed change (Yes, PHPStorm will show it to us), and apply the change one by one? Doing the task using rector is much faster :).

It's just a click. But if you've already done that, it's fine. I will close the PR.

Add a Comment

Login with GitHub to post a comment