-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add example parameter to Action::param method #41
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
Conversation
WalkthroughIntroduces an optional $example string parameter to Action::param in src/Platform/Action.php, stores it alongside existing param metadata, and exposes it through the public options array. Docblock updated. No control flow changes; return type and chaining behavior remain the same. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/Platform/Action.php (2)
171-173: Docblock: add a concise description for $example.Clarify intent for readers/tools, e.g., “Example value used for documentation and SDK generation.”
- * @param string $example + * @param string $example Example value used for documentation and SDK generation.
174-174: Widen$exampletomixed|null- public function param(string $key, mixed $default, Validator|callable $validator, string $description = '', bool $optional = false, array $injections = [], bool $skipValidation = false, bool $deprecated = false, string $example = ''): self + public function param(string $key, mixed $default, Validator|callable $validator, string $description = '', bool $optional = false, array $injections = [], bool $skipValidation = false, bool $deprecated = false, mixed $example = null): selfAllows non-string examples (numbers, arrays, etc.) without casting; no
param()overrides found.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/Platform/Action.php(2 hunks)
🔇 Additional comments (1)
src/Platform/Action.php (1)
176-185: LGTM: example is correctly persisted into params and options.The new field is included consistently in both
$this->params[$key]and$this->options['param:'.$key].
Summary by CodeRabbit