php-github-api icon indicating copy to clipboard operation
php-github-api copied to clipboard

Do not "help" the user by changing parameters

Open Nyholm opened this issue 7 years ago • 2 comments

On 30+ places we have code like this:

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.

Nyholm avatar Apr 14 '17 08:04 Nyholm

Has this already been done in v3?

dereuromark avatar Apr 15 '21 20:04 dereuromark

@dereuromark no this was not done in 3.0. So it will likely be done for 4.0 with deprecations of the current behaviour in 3.x

acrobat avatar Apr 16 '21 10:04 acrobat