From 1e44f5723e4c0e0903d00a61f254901e612fe5e1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 12 Jun 2026 01:01:35 +0900 Subject: feat(symfony-console): port Symfony Console and make the workspace compile Co-Authored-By: Claude Opus 4.8 --- .../exception/command_not_found_exception.rs | 27 +++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs') diff --git a/crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs b/crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs index f1ed60b..ea259b3 100644 --- a/crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs +++ b/crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs @@ -1,13 +1,34 @@ +use super::exception_interface::ExceptionInterface; +use super::invalid_argument_exception::InvalidArgumentException; + #[derive(Debug)] pub struct CommandNotFoundException { - pub message: String, - pub code: i64, + inner: InvalidArgumentException, + alternatives: Vec, +} + +impl CommandNotFoundException { + pub fn new(message: String, alternatives: Vec, code: i64) -> Self { + Self { + inner: InvalidArgumentException(shirabe_php_shim::InvalidArgumentException { + message, + code, + }), + alternatives, + } + } + + pub fn get_alternatives(&self) -> &Vec { + &self.alternatives + } } impl std::fmt::Display for CommandNotFoundException { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.message) + write!(f, "{}", self.inner) } } impl std::error::Error for CommandNotFoundException {} + +impl ExceptionInterface for CommandNotFoundException {} -- cgit v1.3.1