aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/command/dump_completion_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-02 16:16:51 +0900
committernsfisis <nsfisis@gmail.com>2026-08-02 16:16:51 +0900
commit6047bcc3e63ab84dfc67bce94f402f1bfa3f58d5 (patch)
treee0fc935abf0cebb2c557581fbfd098bdef35d558 /crates/shirabe-external-packages/src/symfony/console/command/dump_completion_command.rs
parent4361059d3bb27916179acfebb8889f1863319bb9 (diff)
downloadphp-shirabe-6047bcc3e63ab84dfc67bce94f402f1bfa3f58d5.tar.gz
php-shirabe-6047bcc3e63ab84dfc67bce94f402f1bfa3f58d5.tar.zst
php-shirabe-6047bcc3e63ab84dfc67bce94f402f1bfa3f58d5.zip
refactor(php-shim): introduce PhpClass for reporting PHP class names
Rust has no runtime class name, so `Command::get_class` existed purely to let each command hand back its PHP class name, supplied through the two-argument variant of `delegate_command_trait_impls_to_inner!` at the impl site. Replace it with a general `PhpClass` trait plus an `impl_php_class!` macro, so the name is stated once next to the type definition and the mechanism is reusable outside commands. `Command` gains `PhpClass` as a supertrait and drops `get_class`, and `VcsDriverKind`'s hand-rolled `php_class_name` table moves onto the trait. Behavior is unchanged: the same class-name strings are reported, and the base command state still panics when asked for a name it cannot supply. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/command/dump_completion_command.rs')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/command/dump_completion_command.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/command/dump_completion_command.rs b/crates/shirabe-external-packages/src/symfony/console/command/dump_completion_command.rs
index 680ff962..31a94f0f 100644
--- a/crates/shirabe-external-packages/src/symfony/console/command/dump_completion_command.rs
+++ b/crates/shirabe-external-packages/src/symfony/console/command/dump_completion_command.rs
@@ -10,7 +10,7 @@ use crate::symfony::console::input::input_interface::InputInterface;
use crate::symfony::console::input::input_option::InputOption;
use crate::symfony::console::output::output_interface::{self, OutputInterface};
use crate::symfony::process::process::Process;
-use shirabe_php_shim::PhpMixed;
+use shirabe_php_shim::{PhpMixed, impl_php_class};
use std::ops::{Deref, DerefMut};
/// __DIR__.'/../Resources/completion.bash', embedded at compile time (this port ships as a
@@ -23,6 +23,11 @@ pub struct DumpCompletionCommand {
inner: CommandData,
}
+impl_php_class!(
+ DumpCompletionCommand,
+ r"Symfony\Component\Console\Command\DumpCompletionCommand"
+);
+
impl Deref for DumpCompletionCommand {
type Target = CommandData;
@@ -288,8 +293,5 @@ impl Command for DumpCompletionCommand {
self.complete_impl(input, suggestions)
}
- crate::delegate_command_trait_impls_to_inner!(
- inner,
- "Symfony\\Component\\Console\\Command\\DumpCompletionCommand"
- );
+ crate::delegate_command_trait_impls_to_inner!(inner);
}