KnpLabs / KnpLabs/php-github-api

Do not "help" the user by changing parameters

Ouverte
#566 2 commentaires 4 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
PHP
Étoiles
2.2k
Forks
587
Métriques de merge des PR
Aucune PR mergée en 30 j

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
php
Domaine
api, backend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.