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 摘要。