Skip to content

fix: reject missing keys in CLI::promptByMultipleKeys() - #10654

Open
paulbalandan wants to merge 1 commit into
codeigniter4:developfrom
paulbalandan:prompt-multiple-keys-missing-key
Open

paulbalandan wants to merge 1 commit into
codeigniter4:developfrom
paulbalandan:prompt-multiple-keys-missing-key

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
CLI::promptByMultipleKeys() checked only that no chosen key was larger than the last key of the options, not that every chosen key exists. So:

  • With options keyed 0 and 2, the answer 1 was accepted and returned an empty selection.
  • With options keyed 0, 5 and 2, the answer 5 was rejected.

It now asks again unless every chosen key is one of the option keys. The body is also simplified into a single ask-and-check loop, with no change to what it prints or returns for valid answers.

Checklist:

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

@carson-codeigniter4 carson-codeigniter4 Bot added the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 23, 2026
@paulbalandan
paulbalandan force-pushed the prompt-multiple-keys-missing-key branch from 861dc50 to 83e5eec Compare October 23, 2026 10:47

This branch has not been deployed

No deployments
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.

2 participants