From 766893c139ce2950f30c58d8a1d6d5c1c5858da1 Mon Sep 17 00:00:00 2001 From: zigzagdev Date: Thu, 2 Apr 2026 09:30:23 +0900 Subject: [PATCH 1/2] fix: correct strlen condition to match error message in abort() example --- docs/ja/console-commands/commands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ja/console-commands/commands.md b/docs/ja/console-commands/commands.md index 48f48735ba..1660925989 100644 --- a/docs/ja/console-commands/commands.md +++ b/docs/ja/console-commands/commands.md @@ -196,7 +196,7 @@ class UserCommand extends Command public function execute(Arguments $args, ConsoleIo $io) { $name = $args->getArgument('name'); - if (strlen($name) < 5) { + if (strlen($name) < 4) { // 実行を停止し、標準エラーに出力し、終了コードを 1 に設定 $io->error('Name must be at least 4 characters long.'); $this->abort(); @@ -210,7 +210,7 @@ public function execute(Arguments $args, ConsoleIo $io) public function execute(Arguments $args, ConsoleIo $io) { $name = $args->getArgument('name'); - if (strlen($name) < 5) { + if (strlen($name) < 4) { // 実行を停止しstderrに出力し、終了コードを99に設定します $io->abort('名前は4文字以上にする必要があります。', 99); } From 7278b7f710850598ae5dfbbc1871a3e8de06b4f6 Mon Sep 17 00:00:00 2001 From: zigzagdev Date: Thu, 2 Apr 2026 09:36:00 +0900 Subject: [PATCH 2/2] fix: correct strlen condition to match error message in abort() example in English Document --- docs/en/console-commands/commands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/console-commands/commands.md b/docs/en/console-commands/commands.md index 55cb26ebd8..5e96e5d2cf 100644 --- a/docs/en/console-commands/commands.md +++ b/docs/en/console-commands/commands.md @@ -212,7 +212,7 @@ to terminate execution: public function execute(Arguments $args, ConsoleIo $io): int { $name = $args->getArgument('name'); - if (mb_strlen($name) < 5) { + if (mb_strlen($name) < 4) { // Halt execution, output to stderr, and set exit code to 1 $io->error('Name must be at least 4 characters long.'); $this->abort(); @@ -228,7 +228,7 @@ You can also use `abort()` on the `$io` object to emit a message and code: public function execute(Arguments $args, ConsoleIo $io): int { $name = $args->getArgument('name'); - if (mb_strlen($name) < 5) { + if (mb_strlen($name) < 4) { // Halt execution, output to stderr, and set exit code to 99 $io->abort('Name must be at least 4 characters long.', 99); }