aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-12 01:01:35 +0900
committernsfisis <nsfisis@gmail.com>2026-06-12 01:01:43 +0900
commit1e44f5723e4c0e0903d00a61f254901e612fe5e1 (patch)
tree9c2e1eec364bbf6418a4072ee7767b04c3df0297 /crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs
parentddf0a624145b618c05c2ee47414545b99b685f37 (diff)
downloadphp-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.gz
php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.zst
php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.zip
feat(symfony-console): port Symfony Console and make the workspace compile
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/exception/command_not_found_exception.rs27
1 files changed, 24 insertions, 3 deletions
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<String>,
+}
+
+impl CommandNotFoundException {
+ pub fn new(message: String, alternatives: Vec<String>, code: i64) -> Self {
+ Self {
+ inner: InvalidArgumentException(shirabe_php_shim::InvalidArgumentException {
+ message,
+ code,
+ }),
+ alternatives,
+ }
+ }
+
+ pub fn get_alternatives(&self) -> &Vec<String> {
+ &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 {}