From ee5d0e84c2060f10c20a4b3e519bf0f928fd170d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 5 Aug 2026 02:48:41 +0900 Subject: feat(plugin): discover and list plugin-provided commands Port Application::getPluginCommands: resolve the local composer with plugins force-enabled, fall back to Factory::createGlobal, and collect commands from CommandProvider capability adapters. PhpCommandProxy now mirrors name/description/aliases/hidden over RPC so `list` output matches upstream; input definitions remain TODO(plugin). PhpClass::php_class_name returns an owned String because PHP-backed proxies only know their class at runtime (the override-skip warning prints get_class). CommandProvider::getCommands hands out shared Rc handles since the commands are stored in the application. Factory::createGlobal now propagates createConfig errors instead of swallowing them, and Application::getComposer only catches the exception classes upstream catches, so a ParsingException reaches doRun's GithubActionError path as in Composer. Co-Authored-By: Claude Fable 5 --- crates/shirabe-php-shim/src/lib.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crates/shirabe-php-shim/src/lib.rs') diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index 3012f578..62287c23 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -286,12 +286,13 @@ impl AsAny for T { /// A ported type that reports the name of the PHP class it was ported from. /// -/// Rust has no runtime class name, so the PHP class name is stated once at the type's -/// definition through [`impl_php_class!`]. Implement this wherever the port needs what PHP's -/// `\get_class()` would report. +/// For ported types the PHP class name is stated once at the type's definition through +/// [`impl_php_class!`]; proxy types backed by a PHP-side entity report the entity's runtime +/// class instead. Implement this wherever the port needs what PHP's `\get_class()` would +/// report. pub trait PhpClass { /// The fully-qualified class name, e.g. `Composer\Command\InstallCommand`. - fn php_class_name(&self) -> &'static str; + fn php_class_name(&self) -> String; } /// Implements [`PhpClass`] for a ported type, given the fully-qualified name of the PHP @@ -304,8 +305,8 @@ pub trait PhpClass { macro_rules! impl_php_class { ($ty:ty, $class_name:literal) => { impl $crate::PhpClass for $ty { - fn php_class_name(&self) -> &'static str { - $class_name + fn php_class_name(&self) -> String { + $class_name.to_string() } } }; -- cgit v1.3.1