aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-console/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-10 08:30:45 +0900
committernsfisis <nsfisis@gmail.com>2026-08-10 08:30:45 +0900
commit96fcd5ef671579b5b75e01de99bbe54d8c1e877b (patch)
tree28d4d23d4085cd54ee6297e13d680bff894efc72 /crates/shirabe-symfony-console/src
parentad8d455895038165ec33430e4ff3f68bb21ac207 (diff)
downloadphp-shirabe-96fcd5ef671579b5b75e01de99bbe54d8c1e877b.tar.gz
php-shirabe-96fcd5ef671579b5b75e01de99bbe54d8c1e877b.tar.zst
php-shirabe-96fcd5ef671579b5b75e01de99bbe54d8c1e877b.zip
refactor(symfony-console): drop the unreachable process title surface
Command::setProcessTitle has no caller: neither Composer nor the ported Symfony Console code sets a process title, so run()'s title branch could never fire. The shim it called into was unimplementable anyway — PHP rewrites its own argv block, which Rust hands out only as owned copies. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-symfony-console/src')
-rw-r--r--crates/shirabe-symfony-console/src/command/command.rs40
1 files changed, 0 insertions, 40 deletions
diff --git a/crates/shirabe-symfony-console/src/command/command.rs b/crates/shirabe-symfony-console/src/command/command.rs
index bb4d35e9..6f25595b 100644
--- a/crates/shirabe-symfony-console/src/command/command.rs
+++ b/crates/shirabe-symfony-console/src/command/command.rs
@@ -10,7 +10,6 @@ use crate::input::InputDefinition;
use crate::input::InputInterface;
use crate::input::InputOption;
use crate::output::OutputInterface;
-use crate::output::output_interface;
use indexmap::IndexMap;
use shirabe_php_shim::{PhpMixed, php_regex};
use std::cell::{Cell, Ref};
@@ -30,7 +29,6 @@ use std::cell::{Cell, Ref};
pub struct CommandData {
application: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<dyn Application>>>>,
name: std::cell::RefCell<Option<String>>,
- process_title: std::cell::RefCell<Option<String>>,
aliases: std::cell::RefCell<Vec<String>>,
definition: std::cell::RefCell<Option<InputDefinition>>,
hidden: Cell<bool>,
@@ -63,7 +61,6 @@ impl CommandData {
let this = CommandData {
application: std::cell::RefCell::new(None),
name: std::cell::RefCell::new(None),
- process_title: std::cell::RefCell::new(None),
aliases: std::cell::RefCell::new(Vec::new()),
definition: std::cell::RefCell::new(Some(
InputDefinition::new(Vec::new()).expect("an empty InputDefinition cannot fail"),
@@ -279,8 +276,6 @@ macro_rules! delegate_command_trait_impls_to_inner {
$crate::delegate_to_inner!($field, fn get_native_definition(&self) -> std::cell::Ref<'_, $crate::input::InputDefinition>);
$crate::delegate_to_inner!($field, fn set_name(&self, name: &str) -> anyhow::Result<()>);
$crate::delegate_to_inner!($field, fn get_name(&self) -> Option<String>);
- $crate::delegate_to_inner!($field, fn set_process_title(&self, title: &str));
- $crate::delegate_to_inner!($field, fn get_process_title(&self) -> Option<String>);
$crate::delegate_to_inner!($field, fn set_hidden(&self, hidden: bool));
$crate::delegate_to_inner!($field, fn is_hidden(&self) -> bool);
$crate::delegate_to_inner!($field, fn set_description(&self, description: &str));
@@ -402,29 +397,6 @@ pub trait Command: std::fmt::Debug + shirabe_php_shim::AsAny + shirabe_php_shim:
self.initialize(input.clone(), output.clone())?;
- if let Some(process_title) = self.get_process_title() {
- // TODO(phase-c): PHP probes for cli_set_process_title / setproctitle availability.
- if shirabe_php_shim::function_exists("cli_set_process_title") {
- if !shirabe_php_shim::cli_set_process_title(&process_title) {
- if shirabe_php_shim::PHP_OS == "Darwin" {
- output.borrow_mut().writeln(
- &["<comment>Running \"cli_set_process_title\" as an unprivileged user is not supported on MacOS.</comment>".to_string()],
- output_interface::VERBOSITY_VERY_VERBOSE,
- );
- } else {
- shirabe_php_shim::cli_set_process_title(&process_title);
- }
- }
- } else if shirabe_php_shim::function_exists("setproctitle") {
- shirabe_php_shim::setproctitle(&process_title);
- } else if output.borrow().get_verbosity() == output_interface::VERBOSITY_VERY_VERBOSE {
- output.borrow_mut().writeln(
- &["<comment>Install the proctitle PECL to be able to change the process title.</comment>".to_string()],
- output_interface::OUTPUT_NORMAL,
- );
- }
- }
-
if input.borrow().is_interactive() {
self.interact(input.clone(), output.clone());
}
@@ -483,10 +455,6 @@ pub trait Command: std::fmt::Debug + shirabe_php_shim::AsAny + shirabe_php_shim:
fn get_name(&self) -> Option<String>;
- fn set_process_title(&self, title: &str);
-
- fn get_process_title(&self) -> Option<String>;
-
fn set_hidden(&self, hidden: bool);
fn is_hidden(&self) -> bool;
@@ -684,14 +652,6 @@ impl Command for CommandData {
self.name.borrow().clone()
}
- fn set_process_title(&self, title: &str) {
- *self.process_title.borrow_mut() = Some(title.to_string());
- }
-
- fn get_process_title(&self) -> Option<String> {
- self.process_title.borrow().clone()
- }
-
fn set_hidden(&self, hidden: bool) {
self.hidden.set(hidden);
}