__rhandle = $name; $this->__epoch = $args; return; } if (!is_string($name)) { throw new \RuntimeException( 'Shirabe does not support constructing ' . static::class . ' inside the plugin process without an event name' ); } $this->__rhandle = null; $this->name = $name; $this->args = $args; $this->flags = $flags; } public function __destruct() { if ($this->__rhandle !== null) { \ShirabeRustObjectRegistry::release($this->__rhandle); } } public function __shirabeRustHandleDescriptor(): ?array { if ($this->__rhandle === null) { return null; } return [ '__rhandle' => $this->__rhandle, '__class' => static::class, '__epoch' => $this->__epoch, ]; } public function getName(): string { if ($this->__rhandle !== null) { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getName', []); } return $this->name; } public function getArguments(): array { if ($this->__rhandle !== null) { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getArguments', []); } return $this->args; } public function getFlags(): array { if ($this->__rhandle !== null) { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getFlags', []); } return $this->flags; } public function isPropagationStopped(): bool { if ($this->__rhandle !== null) { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'isPropagationStopped', []); } return $this->propagationStopped; } public function stopPropagation(): void { if ($this->__rhandle !== null) { \ShirabeRpcRuntime::callRust($this->__rhandle, 'stopPropagation', []); return; } $this->propagationStopped = true; } }