Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: herd php:install ignores the version argument and asks which version to install

オープン 初心者向け
#1,771 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
83/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
cli

調査の方向性

まず php:install コマンドを見つけ、issue の説明に従って、そのバージョン引数を php:update コマンドの phpVersion 引数と比較します。コマンドのヘルプを確認し、herd php:install 8.4 で再現して、引数が無視されることを確認します。コマンドが確認を求めずに指定されたバージョンをインストールしたら完了です。対話型と非対話型の動作を確認してください。

索引モデルが issue の本文から書いたものです。

説明

macOS
Platform

macOS

Operating system version

macOS 27.0.1 (26A434)

System architecture

ARM64 (M1, M2, etc)

Herd Version

2.0.2 (Build: 71)

PHP Version

Not version-specific (global PHP here: 8.5.10)

Bug description

herd php:install 8.4 ignores the 8.4: instead of installing PHP 8.4 it asks "Which PHP version do you want to install?". That is the usage shown in the docs (herd php:install 8.3), in herd list and in herd php:install --help (php:install [<version>]).

In a terminal you can pick the version from the list. Without one (CI, an AI agent, input from a pipe) the command fails with exit code 1 and tells you to "Pass the value as an argument or option instead", although it was passed (log below).

Expected: herd php:install 8.4 installs PHP 8.4 without asking.

Cause, read in herd.phar 2.0.2: Silly's Application::command() merges $input->getOptions() after $input->getArguments(), so Symfony Console's global --version option (false when not given) overwrites the argument that is also named version. php:install is the only Herd command with an argument of that name; php:update [phpVersion] and isolate [phpVersion] are not affected.

Suggestion: rename the argument to phpVersion, as php:update does.

Workaround: install the version in Settings → PHP, or pick it from the list in a terminal.

Steps to reproduce
  1. Herd 2.0.2 with a PHP version that is not installed (here 8.4).
  2. In a terminal, run herd php:install 8.4: it asks which version to install instead of installing 8.4. Press Ctrl-C (nothing is installed).
  3. Without a terminal: herd php:install 8.4 < /dev/null fails with exit code 1.
Relevant log output
$ herd php:install 8.4

 ┌ Which PHP version do you want to install? ───────────────────┐
 │ › ● 8.6                                                    ┃ │
 │   ○ 8.4                                                    │ │
 │   ○ 8.3                                                    │ │
 │   ○ 8.2                                                    │ │
 │   ○ 8.1                                                    │ │
 └──────────────────────────────────────────────────────────────┘
  ⚠ Cancelled.
# (Ctrl-C pressed at the question)

$ herd php:install 8.4 < /dev/null; echo "exit=$?"

In app.php line 92:

  "herd php:install" asked a question but no terminal is attached to answer i
  t. Pass the value as an argument or option instead (see "herd help php:inst
  all").


php:install [<version>]

exit=1
主要言語
言語のデータがありません
スター
124
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

beyondcode/herd-community のほかの issue

beyondcode/herd-community の issue をすべて見る

似ている issue

CLI の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。