From 6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 11 Jun 2026 02:39:35 +0900 Subject: 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) --- crates/shirabe/src/dependency_resolver/rule.rs | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/rule.rs') 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 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 { @@ -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 { @@ -774,7 +758,7 @@ impl std::fmt::Display for Rule { pub struct RuleBase { pub(crate) bitfield: i64, pub(crate) request: Option, - pub(crate) reason_data: Option, + pub(crate) reason_data: ReasonData, } impl RuleBase { @@ -788,7 +772,7 @@ impl RuleBase { Self { bitfield, request: None, - reason_data: Some(reason_data), + reason_data, } } -- cgit v1.3.1