command 'phpstan:init' should not return 0 when file not overriden
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 42/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- PHP
- Sterne
- 37
- Forks
- 20
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PrestaShop/php-dev-tools
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 45/100
PrestaShop/php-dev-tools#68 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
PrestaShop/php-dev-tools#55 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 50/100
PrestaShop/php-dev-tools#45 · 2 Reaktionen ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
PrestaShop/php-dev-tools#38 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
PrestaShop/php-dev-tools#26 ·
Alle Issues in PrestaShop/php-dev-tools
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
[Bug]: Detection::detectString() / detectContent() never use finfo – missing use finfo; (regression from #54077)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen0. Needs triage 35-feedback bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
getgrav/grav-plugin-api#74 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
heroku/heroku-buildpack-php#1024 ·
Maintainer antworten meist innerhalb von 1 Tag