diff options
Diffstat (limited to 'crates/shirabe-php-rpc/php/stubs/Composer/IO/BaseIO.php')
| -rw-r--r-- | crates/shirabe-php-rpc/php/stubs/Composer/IO/BaseIO.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/shirabe-php-rpc/php/stubs/Composer/IO/BaseIO.php b/crates/shirabe-php-rpc/php/stubs/Composer/IO/BaseIO.php index 55da6415..b3e0fb51 100644 --- a/crates/shirabe-php-rpc/php/stubs/Composer/IO/BaseIO.php +++ b/crates/shirabe-php-rpc/php/stubs/Composer/IO/BaseIO.php @@ -42,6 +42,16 @@ abstract class BaseIO implements IOInterface, \ShirabeRustStub ]; } + public function __clone() + { + // PHP has already shallow-copied this stub, so both copies would point at one + // entity and release it twice. The Rust side clones the entity instead, applying + // whatever __clone semantics the real class defines, and this copy rebinds to the + // fresh handle. Entities without clone semantics answer with an explicit error. + [$this->__rhandle, $this->__epoch] = \ShirabeRpcRuntime::callRust($this->__rhandle, '__shirabeClone', []); + \ShirabeRustObjectRegistry::adopt($this->__rhandle, $this); + } + public function isInteractive() { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'isInteractive', []); |
