command 'phpstan:init' should not return 0 when file not overriden
まだ誰も着手していません。
評価
調査の方向性
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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
PrestaShop/php-dev-tools#38 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
PrestaShop/php-dev-tools#26 ·
PrestaShop/php-dev-tools の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
smarty-php/smarty#1215 ·