KnpLabs / KnpLabs/php-github-api
Do not "help" the user by changing parameters
- Dominant language
- PHP
- Stars
- 2.2k
- Forks
- 587
- PR merge metrics
- No merged PRs in 30d
Description
On 30+ places we have code like this:
```php
if (!in_array($state, array('open', 'closed'))) {
$state = 'open';
}
```
If the user misspelled the `$state` we should not help them. That may cause unpredicted actions. We should throw an exception or let the API call fail.
This is a BC break. I've marked it in milestone 3.0.
Contributor guide
No contributing guide indexed for this repository
Research direction
Search the PHP source for the repeated in_array parameter-normalization pattern and review how invalid API parameters currently fail. Determine the consistent failure behavior and identify all affected locations; done means misspelled parameters are no longer silently changed and the existing test suite passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100