command 'phpstan:init' should not return 0 when file not overriden
还没有人认领这个 Issue。
评估
调研方向
Start by locating the phpstan:init command and inspect how it handles an existing phpstan.neon file in non-interactive mode. Reproduce the case with --dest and an existing file, then verify that the process reports a nonzero exit status when no file is copied, while preserving the successful status for an actual installation.
由索引模型根据 Issue 内容生成。
描述
Use case :
- the command is invoked from a script (external symfony command for example), in non-interactive mode (interactive mode is not possible in this context)
phpstan.neonfile already exists
Was the command successful ? I think not, the new file was not copied/installed, we can't consider the init process is a success.
So in this case, command should return 1 or another code maybe 2, but not 0. (2 or more is best option I suppose).
Furthermore, there is another argument for arguing that the command should return 1.
Because of the non possible interaction, symfony has started to fill the errorOutput content, which means that symfony considers that an error happend. ($installPhpStanConfiguration->getErrorOutput() has content, see below).
Example :
$this->io->write("Installation of {$this->getScriptName()} configuration file : ", false);
$installPhpStanConfiguration = new Process(['php', 'vendor/bin/prestashop-coding-standards', 'phpstan:init', '--dest', getcwd()]);
$installPhpStanConfiguration->start();
$installPhpStanConfiguration->wait();
if (!$installPhpStanConfiguration->isSuccessful()) {
$this->io->error('failed !');
throw new RuntimeException("{$this->getPackageName()} configuration : {$installPhpStanConfiguration->getErrorOutput()}");
}
// The process is reported to successful even if the new file was not written :(
// fun fact : isSuccessuf() is true but getErrorOutput() has content
// at this point, we should parse the getErrorOutput() content to guess if an error happened.
- 主要语言
- PHP
- 星标
- 37
- 派生
- 20
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PrestaShop/php-dev-tools 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 45/100
PrestaShop/php-dev-tools#68 ·
-
难度 4/5 3-5 天 新手友好度 35/100
PrestaShop/php-dev-tools#55 ·
-
难度 2/5 1-3 小时 新手友好度 50/100
PrestaShop/php-dev-tools#45 · 2 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 45/100
PrestaShop/php-dev-tools#38 ·
-
难度 5/5 一周以上 新手友好度 25/100
PrestaShop/php-dev-tools#26 ·
查看 PrestaShop/php-dev-tools 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
Featured image not passed to checks in the Tasks column or publish blocks可能已有人在做 @roborourke 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
humanmade/publication-checklist#100 ·
维护者通常 1 天内回复
-
bug customer-reported
难度 2/5 1-3 小时 新手友好度 62/100
MagnaCapax/PMSS#1072 ·
维护者通常 5 天内回复
-
难度 2/5 半天 新手友好度 68/100
components-web-app/docs#244 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
getgrav/grav-plugin-api#60 ·