diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:57 +0900 |
| commit | f31b101ce1e921a026ba234b1f0a83b0392bc118 (patch) | |
| tree | b7ac2aa84d71ebd162cc21aeab0240e7e0544988 /crates/shirabe-external-packages/src/react | |
| parent | 5e31fa33c3b5cf726a57a063b8e7a070869250fe (diff) | |
| download | php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.gz php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.zst php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.zip | |
fix(compile): fix all remaining compile errors
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/react')
| -rw-r--r-- | crates/shirabe-external-packages/src/react/promise/promise_interface.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/react/promise/promise_interface.rs b/crates/shirabe-external-packages/src/react/promise/promise_interface.rs index bb604a8..5836945 100644 --- a/crates/shirabe-external-packages/src/react/promise/promise_interface.rs +++ b/crates/shirabe-external-packages/src/react/promise/promise_interface.rs @@ -6,4 +6,33 @@ pub trait PromiseInterface { on_fulfilled: Option<Box<dyn FnOnce(Option<PhpMixed>) -> Option<PhpMixed>>>, on_rejected: Option<Box<dyn FnOnce(Option<PhpMixed>) -> Option<PhpMixed>>>, ) -> Box<dyn PromiseInterface>; + + /// PHP closure shape: `fn(mixed): mixed`. Convenience wrapper around `then` + /// for call sites that don't deal in `Option<PhpMixed>`. + fn then_with( + &self, + _on_fulfilled: Option<Box<dyn FnOnce(PhpMixed) -> PhpMixed>>, + _on_rejected: Option<Box<dyn FnOnce(PhpMixed) -> PhpMixed>>, + ) -> Box<dyn PromiseInterface> { + todo!() + } + + /// PHP closure shape: `fn(mixed): mixed`, returning a `Box<dyn PromiseInterface>`. + fn then_boxed( + &self, + _on_fulfilled: Option<Box<dyn FnOnce(PhpMixed) -> Box<dyn PromiseInterface>>>, + _on_rejected: Option<Box<dyn FnOnce(PhpMixed) -> Box<dyn PromiseInterface>>>, + ) -> Box<dyn PromiseInterface> { + todo!() + } + + /// Variant used by composer_repository where accept returns PhpMixed but reject returns + /// an error/PhpMixed and the result is the same Promise pipeline. + fn then_with_reject_boxed( + &self, + _on_fulfilled: Box<dyn FnOnce(PhpMixed) -> anyhow::Result<PhpMixed>>, + _on_rejected: Box<dyn FnOnce(anyhow::Error) -> anyhow::Result<PhpMixed>>, + ) -> Box<dyn PromiseInterface> { + todo!() + } } |
