KnpLabs / KnpLabs/php-github-api

Do not "help" the user by changing parameters

未关闭
#566 2 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
PHP
星标
2.2k
派生
587
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
api, backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。