aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/io
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-08 01:54:56 +0900
committernsfisis <nsfisis@gmail.com>2026-06-08 01:54:56 +0900
commit318ea948f5932dfa7942081a269d62fd7161a9bf (patch)
tree0fff2fe818f87a20dea89a51901f9e16071f2f53 /crates/shirabe/src/io
parentf232d7f9d2936ef84bd904cacd21c12cb7012b34 (diff)
downloadphp-shirabe-318ea948f5932dfa7942081a269d62fd7161a9bf.tar.gz
php-shirabe-318ea948f5932dfa7942081a269d62fd7161a9bf.tar.zst
php-shirabe-318ea948f5932dfa7942081a269d62fd7161a9bf.zip
feat(phase-c): resolve reflection/downcast phase-b TODOs
Resolve category F phase-b TODOs (class-string, instanceof, get_class, method_exists, __FILE__, Reflection API, downcast). - VcsRepository: dispatch drivers through a VcsDriverKind enum (instantiate/supports/php_class_name) and add constructors to the concrete VCS drivers - repository downcasts via RepositoryInterfaceHandle::downcast_rc and as_any (init/show commands, vcs ValidatingArrayLoader) - BaseCommand::is_self_update_command override replaces an instanceof - Factory::create narrows PartialComposer to ComposerHandle via as_full - InstalledVersions gains set_self_dir/set_installed_is_local_dir, replacing Reflection-based static property mutation - ClassLoader::as_array_iter ports the PHP (array) cast - drop the unnecessary __FILE__ phar branch in self-update application get_class(command) reclassified TODO(plugin); buffer_io StreamableInputInterface downcast and the ValidatingArrayLoader trait redesign left as tracked TODOs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/io')
-rw-r--r--crates/shirabe/src/io/buffer_io.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/crates/shirabe/src/io/buffer_io.rs b/crates/shirabe/src/io/buffer_io.rs
index 0696c1c..7c999f8 100644
--- a/crates/shirabe/src/io/buffer_io.rs
+++ b/crates/shirabe/src/io/buffer_io.rs
@@ -100,14 +100,17 @@ impl BufferIO {
}
pub fn set_user_inputs(&mut self, inputs: Vec<String>) -> Result<()> {
- // TODO(phase-b): downcast Box<dyn InputInterface> to StreamableInputInterface.
- // as_any/set_stream are not yet exposed on the InputInterface trait object.
+ // PHP: `if (!$this->input instanceof StreamableInputInterface) { throw ... }`
+ // `$this->input->setStream($this->createStream($inputs)); $this->input->setInteractive(true);`
+ //
+ // TODO(phase-b): blocked on the symfony console crate-path duplication (see `new`/`get_output`):
+ // `StreamableInputInterface` lives under `symfony::console::input`, but ConsoleIO's input is
+ // a `symfony::component::console::input::InputInterface` from a separate, unrelated trait
+ // tree, so the `instanceof` downcast cannot be expressed until those trees are unified.
let _ = inputs;
- let _ = |i: &Box<dyn InputInterface>| -> bool {
- let _ = i;
- false
- };
- todo!("port BufferIO::set_user_inputs once StreamableInputInterface downcast is available")
+ todo!(
+ "BufferIO::set_user_inputs: blocked on unifying symfony::console / symfony::component::console input trait trees"
+ )
}
fn create_stream(&self, inputs: Vec<String>) -> Result<PhpMixed> {