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

fix: precedence of command classes with the same $name #8898

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented May 17, 2024

Description
This PR allows users to override commands in the framework with commands in App\Commands,
and prevents other packages from overriding commands in the framework.

This PR changes to use the first command class discovered.
In the current implementation, the last class discovered is executed.
However, for CI4's behavior, if there is a command class in App\Commands, it should take precedence.

See also https://forum.codeigniter.com/showthread.php?tid=90877&pid=418854#pid418854

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label May 17, 2024
@kenjis kenjis marked this pull request as draft May 17, 2024 00:16
Now you can replace CI4's commands with your commands in app/Commands/.
@kenjis kenjis force-pushed the fix-command-discovery branch 4 times, most recently from 8ce24a7 to 831ffcb Compare June 18, 2024 02:30
@kenjis kenjis marked this pull request as ready for review June 18, 2024 02:44
@kenjis kenjis merged commit 9d02066 into codeigniter4:develop Jun 24, 2024
41 checks passed
@kenjis kenjis deleted the fix-command-discovery branch June 24, 2024 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants