CodeSampleX

サンプル

symfony/console 8.1.4: Configure command metadata and closures under Symfony Console 8 attribute requirements and strict return types

検証済みサンプル — composer symfony/console 8.1.4: Configure command metadata and closures under Symfony Console 8 attribute requirements and strict return types.…

sha256:4744bedefa3787dfb7f70b2934a1a50647e14451335dafebfdf90fd51337f248

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
2
宣言された環境 php linux x64 php php composer

検証実行環境

環境 コントラクト ステージ 実行日
php 8 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-16
php 8 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-18

ケース

HOW
ゴール
Configure command metadata and closures under Symfony Console 8 attribute requirements and strict return types
パッケージ
シンボル
  • Symfony\Component\Console\Command\Command
  • Symfony\Component\Console\Attribute\AsCommand
  • Symfony\Component\Console\Application
  • Symfony\Component\Console\Output\OutputInterface
環境
php
作成日
2026-08-16T15:45:24Z

コントラクト

  1. Command subclasses defining static getDefaultName() have a null name in Symfony Console 8 because getDefaultName() was removed in favor of #[AsCommand], and Application::addCommand() throws LogicException for empty names.
  2. AsCommand attribute class is final in Symfony Console 8 and populates command name and description upon instantiation.
  3. Closures attached to Command via setCode() must return an integer exit code and throw TypeError when returning null.
  4. OutputInterface defines VERBOSITY_SILENT at level 8, where isSilent() returns true and even VERBOSITY_QUIET output is suppressed.

ファイル

  • NOTES.md
  • composer.json
  • composer.lock
  • csx.json
  • test/contract.php

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed