aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/command/lazy_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-13 11:38:20 +0900
committernsfisis <nsfisis@gmail.com>2026-06-13 17:49:15 +0900
commit69c372ba0eca61b05260d6d208445d9e69d14e34 (patch)
treeab837346f5729a5a4a67ccd83462033511b41c89 /crates/shirabe-external-packages/src/symfony/console/command/lazy_command.rs
parentefe5bdb1987411a473d4af15451a376d20928245 (diff)
downloadphp-shirabe-69c372ba0eca61b05260d6d208445d9e69d14e34.tar.gz
php-shirabe-69c372ba0eca61b05260d6d208445d9e69d14e34.tar.zst
php-shirabe-69c372ba0eca61b05260d6d208445d9e69d14e34.zip
fix(console): flatten Application inheritance to restore overrides
Composer\Console\Application embedded Symfony's Application as an `inner` field and delegated to it, so polymorphic calls inside the Symfony base (e.g. doRun -> $this->getLongVersion()) resolved to Symfony's own methods and never reached Composer's overrides. As a result `--version` bypassed Composer's getLongVersion()/doRun() entirely. Flatten the PHP inheritance chain into the single shirabe Application struct: take in the Symfony base methods (parent-calling overrides kept under a `base_` prefix) and drop the `inner` delegation. Replace the Symfony Application struct in shirabe-external-packages with an `Application` trait that the merged struct implements, so commands and descriptors can reference it without a reverse crate dependency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/command/lazy_command.rs')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/command/lazy_command.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/command/lazy_command.rs b/crates/shirabe-external-packages/src/symfony/console/command/lazy_command.rs
index 47f73bf..924d4bd 100644
--- a/crates/shirabe-external-packages/src/symfony/console/command/lazy_command.rs
+++ b/crates/shirabe-external-packages/src/symfony/console/command/lazy_command.rs
@@ -78,7 +78,7 @@ impl LazyCommand {
self.get_command().ignore_validation_errors();
}
- pub fn set_application(&mut self, application: Option<Rc<RefCell<Application>>>) {
+ pub fn set_application(&mut self, application: Option<Rc<RefCell<dyn Application>>>) {
// if ($this->command instanceof parent)
if let LazyCommandInner::Command(command) = &mut self.command {
command.set_application(application.clone());
@@ -288,11 +288,11 @@ impl Command for LazyCommand {
todo!()
}
- fn set_application(&mut self, application: Option<Rc<RefCell<Application>>>) {
+ fn set_application(&mut self, application: Option<Rc<RefCell<dyn Application>>>) {
LazyCommand::set_application(self, application);
}
- fn get_application(&self) -> Option<Rc<RefCell<Application>>> {
+ fn get_application(&self) -> Option<Rc<RefCell<dyn Application>>> {
self.inner.get_application()
}