Skip to content

fix: fix ModelCommand and ResourceCommand in dev generator#397

Merged
albertcht merged 2 commits into
0.3from
hotfix/fix-some-generator-commands
Jun 22, 2026
Merged

fix: fix ModelCommand and ResourceCommand in dev generator#397
albertcht merged 2 commits into
0.3from
hotfix/fix-some-generator-commands

Conversation

@albertcht

Copy link
Copy Markdown
Member

No description provided.

@albertcht albertcht added the bug Something isn't working label Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e4ad2719-9ad4-493c-ac08-823363dcac72

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/fix-some-generator-commands

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes two generator commands (ModelCommand, ResourceCommand) that were missing the --path option introduced in the parent Hyperf GeneratorCommand, and simplifies pool-proxy class resolution in HasPoolProxy.

  • ResourceCommand is fixed cleanly by merging with parent::getOptions(), so all current and future parent options are inherited automatically.
  • ModelCommand hard-codes --path directly without calling parent::getOptions(), which works today but diverges from the pattern used by most sibling commands and will silently miss any option the parent adds in the future.
  • HasPoolProxy replaces a verbose property_exists guard with ??=, which is safe for all six current trait users but removes the PoolProxy::class fallback and drops the @phpstan-ignore annotation that may still be needed.

Confidence Score: 5/5

All three changes are safe to merge; the functional fixes are correct and no existing behavior is broken.

Both generator commands now expose the missing --path option correctly. The HasPoolProxy simplification works for every current consumer of the trait. The remaining inconsistencies are style-level and do not affect runtime behavior.

src/object-pool/src/Traits/HasPoolProxy.php — verify PHPStan passes without an explicit annotation on the $this->poolProxyClass access.

Important Files Changed

Filename Overview
src/devtool/src/Generator/ResourceCommand.php Bug fix: merges with parent::getOptions() so the --path option (and any future parent options) are inherited automatically.
src/devtool/src/Generator/ModelCommand.php Adds --path option directly to the options array without calling parent::getOptions(), unlike most sibling commands that use array_merge(parent::getOptions(), ...); functional fix is correct but inconsistent with the rest of the codebase.
src/object-pool/src/Traits/HasPoolProxy.php Simplifies proxy-class resolution with ??= but removes the PoolProxy::class fallback and the @PHPStan-Ignore guard; works for all six current trait users but may require a new PHPStan suppression annotation.

Reviews (2): Last reviewed commit: "fix: fix phpstan 2.2" | Re-trigger Greptile

@albertcht albertcht merged commit 0719b26 into 0.3 Jun 22, 2026
17 checks passed
@albertcht albertcht deleted the hotfix/fix-some-generator-commands branch June 22, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant