diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-11 02:39:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-11 02:39:35 +0900 |
| commit | 6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83 (patch) | |
| tree | e39261f4aa7314fe8c75142670c76591cdaccb92 /crates/shirabe/src/dependency_resolver/rule.rs | |
| parent | 5d3232a80be4b989e89cc7ae4e3642cc5acae030 (diff) | |
| download | php-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.tar.gz php-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.tar.zst php-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.zip | |
feat(console): resolve phase-b TODOs in doRun and IO wiring
Wire up ConsoleIO with HelperSet/QuestionHelper, register the
ErrorHandler with the IO instance, and fall back to a default output
in run(). Replace resolved phase-b TODOs across the console, command,
io, factory, installer, dependency_resolver, and util modules; reclassify
the remaining blockers (typed Symfony command registry, stdin resource
caching) as phase-c.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/dependency_resolver/rule.rs')
| -rw-r--r-- | crates/shirabe/src/dependency_resolver/rule.rs | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/crates/shirabe/src/dependency_resolver/rule.rs b/crates/shirabe/src/dependency_resolver/rule.rs index 4e5a920..e62bb7b 100644 --- a/crates/shirabe/src/dependency_resolver/rule.rs +++ b/crates/shirabe/src/dependency_resolver/rule.rs @@ -42,21 +42,6 @@ pub enum ReasonData { Fixed { package: BasePackageHandle, }, - /// Phase B placeholder for an arbitrary PHP-side value not yet mapped to a real variant. - Mixed(PhpMixed), -} - -impl From<PhpMixed> for ReasonData { - fn from(value: PhpMixed) -> Self { - // TODO(phase-b): callers should construct the appropriate variant directly; - // this catch-all keeps the rule constructors building while reason_data threading - // through PhpMixed in the resolver is still in transition. - match value { - PhpMixed::String(s) => ReasonData::String(s), - PhpMixed::Int(i) => ReasonData::Int(i), - other => ReasonData::Mixed(other), - } - } } // reason constants and // their reason data contents @@ -106,8 +91,8 @@ impl Rule { &mut self.base_mut().bitfield } - fn reason_data(&self) -> Option<&ReasonData> { - self.base().reason_data.as_ref() + fn reason_data(&self) -> &ReasonData { + &self.base().reason_data } pub fn get_literals(&self) -> Vec<i64> { @@ -161,8 +146,7 @@ impl Rule { /// @phpstan-return ReasonData pub fn get_reason_data(&self) -> &ReasonData { - // TODO(phase-b): reason_data() returns Option; PHP getReasonData unconditional - self.reason_data().unwrap() + self.reason_data() } pub fn get_required_package(&self) -> Option<String> { @@ -774,7 +758,7 @@ impl std::fmt::Display for Rule { pub struct RuleBase { pub(crate) bitfield: i64, pub(crate) request: Option<Request>, - pub(crate) reason_data: Option<ReasonData>, + pub(crate) reason_data: ReasonData, } impl RuleBase { @@ -788,7 +772,7 @@ impl RuleBase { Self { bitfield, request: None, - reason_data: Some(reason_data), + reason_data, } } |
