diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-13 11:38:20 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-13 17:49:15 +0900 |
| commit | 69c372ba0eca61b05260d6d208445d9e69d14e34 (patch) | |
| tree | ab837346f5729a5a4a67ccd83462033511b41c89 /crates/shirabe-external-packages/src/symfony/console/descriptor/markdown_descriptor.rs | |
| parent | efe5bdb1987411a473d4af15451a376d20928245 (diff) | |
| download | php-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/descriptor/markdown_descriptor.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/console/descriptor/markdown_descriptor.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/descriptor/markdown_descriptor.rs b/crates/shirabe-external-packages/src/symfony/console/descriptor/markdown_descriptor.rs index 1fec085..90cad25 100644 --- a/crates/shirabe-external-packages/src/symfony/console/descriptor/markdown_descriptor.rs +++ b/crates/shirabe-external-packages/src/symfony/console/descriptor/markdown_descriptor.rs @@ -214,7 +214,7 @@ impl MarkdownDescriptor { fn describe_application( &mut self, - application: std::rc::Rc<std::cell::RefCell<Application>>, + application: std::rc::Rc<std::cell::RefCell<dyn Application>>, options: IndexMap<String, PhpMixed>, ) -> anyhow::Result<()> { let described_namespace = match options.get("namespace") { @@ -223,7 +223,7 @@ impl MarkdownDescriptor { }; let mut description = ApplicationDescription::new(application.clone(), described_namespace, false); - let title = self.get_application_title(&application.borrow()); + let title = self.get_application_title(&*application.borrow()); self.write( &format!( @@ -289,7 +289,7 @@ impl MarkdownDescriptor { Ok(()) } - fn get_application_title(&self, application: &Application) -> String { + fn get_application_title(&self, application: &dyn Application) -> String { if "UNKNOWN" != application.get_name() { if "UNKNOWN" != application.get_version() { return format!( @@ -376,7 +376,7 @@ impl Descriptor for MarkdownDescriptor { fn describe_application( &mut self, - application: std::rc::Rc<std::cell::RefCell<Application>>, + application: std::rc::Rc<std::cell::RefCell<dyn Application>>, options: IndexMap<String, PhpMixed>, ) -> anyhow::Result<()> { MarkdownDescriptor::describe_application(self, application, options) |
