샘플
Preserve input types and values across Symfony Console ArrayInput string serialization, StringInput single-quote escape handling, and ArgvInput re-binding
sha256:4aff81928d83c14745510bd1f4d6811c8ea779881c9bce8e5dc69ad8cc10cb7c
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Preserve input types and values across Symfony Console ArrayInput string serialization, StringInput single-quote escape handling, and ArgvInput re-binding HOW
- 패키지
- symfony/console 8.1.4
- 환경
- php
- 생성일
- 2026-08-16T14:02:07Z
흔히 이렇게 알고 있다
Serializing an ArrayInput instance to a CLI string with __toString() produces argument tokens that preserve boolean flag states and option values when round-tripped through StringInput.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- ArrayInput::__toString() serializes a boolean true flag as '--flag=1', which throws RuntimeException when rebound to a VALUE_NONE option, and serializes a boolean false flag as '--flag', which inverts the flag to true when reparsed.
- ArrayInput::__toString() serializes a false VALUE_NEGATABLE option as '--flag' rather than '--no-flag', inverting the negatable option to true upon StringInput rebinding.
- ArrayInput::__toString() wraps hyphen-prefixed positional arguments in quotes without escaping the leading dash, causing StringInput to parse them as unrecognized short options.
- ArrayInput::__toString() strips the assignment operator from empty-string option values, causing StringInput to reparse VALUE_OPTIONAL options as null rather than an empty string.
- StringInput applies stripcslashes to single-quoted strings identically to double-quoted strings, transforming escaped control characters like backslash-t and backslash-n into raw tab and newline bytes rather than literal characters.
- ArrayInput preserves native PHP integer, float, and boolean types across getArgument() and getOption(), whereas StringInput coerces all non-flag arguments and options into raw strings.
파일
- NOTES.md
- composer.json
- composer.lock
- csx.json
- test/contract.php
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- php 8 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · composer@1 · 2026-08-16 · ed25519:d91480838ac982c9