aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--crates/shirabe/src/console/application.rs7
-rw-r--r--crates/shirabe/src/io/buffer_io.rs4
-rw-r--r--crates/shirabe/src/io/console_io.rs4
-rw-r--r--crates/shirabe/src/io/io_interface.rs5
4 files changed, 14 insertions, 6 deletions
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index 7c527c6..379add7 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -2475,12 +2475,7 @@ impl ApplicationHandle {
.has_parameter_option(PhpMixed::from(vec!["--profile"]), false)
{
start_time = Some(microtime());
- // PHP: $this->io->enableDebugging($startTime).
- // TODO(phase-c): enableDebugging exists only on ConsoleIO, not on IOInterface,
- // and self.io is still the NullIO because the ConsoleIO construction above is
- // deferred (Symfony HelperSet/Helper modelling). Once self.io is the real
- // ConsoleIO this becomes a concrete-type call on it.
- let _ = start_time.unwrap();
+ io.borrow_mut().enable_debugging(start_time.unwrap());
}
let result = self.base_do_run(input.clone(), output.clone())?;
diff --git a/crates/shirabe/src/io/buffer_io.rs b/crates/shirabe/src/io/buffer_io.rs
index af7ae61..72c452b 100644
--- a/crates/shirabe/src/io/buffer_io.rs
+++ b/crates/shirabe/src/io/buffer_io.rs
@@ -273,6 +273,10 @@ impl crate::io::IOInterface for BufferIO {
fn as_base_io_mut(&mut self) -> Option<&mut dyn crate::io::BaseIO> {
Some(self)
}
+
+ fn enable_debugging(&mut self, start_time: f64) {
+ self.inner.enable_debugging(start_time)
+ }
}
impl crate::io::BaseIO for BufferIO {
diff --git a/crates/shirabe/src/io/console_io.rs b/crates/shirabe/src/io/console_io.rs
index 210dbdc..eb7ab31 100644
--- a/crates/shirabe/src/io/console_io.rs
+++ b/crates/shirabe/src/io/console_io.rs
@@ -678,6 +678,10 @@ impl IOInterface for ConsoleIO {
fn as_base_io_mut(&mut self) -> Option<&mut dyn BaseIO> {
Some(self)
}
+
+ fn enable_debugging(&mut self, start_time: f64) {
+ self.enable_debugging(start_time)
+ }
}
impl BaseIO for ConsoleIO {
diff --git a/crates/shirabe/src/io/io_interface.rs b/crates/shirabe/src/io/io_interface.rs
index 1ae8d28..af3f688 100644
--- a/crates/shirabe/src/io/io_interface.rs
+++ b/crates/shirabe/src/io/io_interface.rs
@@ -155,6 +155,11 @@ pub trait IOInterface: IOInterfaceImmutable + IOInterfaceMutable {
fn as_base_io_mut(&mut self) -> Option<&mut dyn crate::io::BaseIO> {
None
}
+
+ // PHP: only `ConsoleIO::enableDebugging` exists; the interface itself does not declare it.
+ fn enable_debugging(&mut self, _start_time: f64) {
+ panic!("enable_debugging is only supported by ConsoleIO/BufferIO");
+ }
}
// Shared-ownership handle for a PHP IO instance (reference semantics). It