diff options
Diffstat (limited to 'crates/shirabe-php-rpc/php/stubs')
| -rw-r--r-- | crates/shirabe-php-rpc/php/stubs/Composer/EventDispatcher/Event.php | 59 | ||||
| -rw-r--r-- | crates/shirabe-php-rpc/php/stubs/Composer/Script/Event.php | 37 |
2 files changed, 96 insertions, 0 deletions
diff --git a/crates/shirabe-php-rpc/php/stubs/Composer/EventDispatcher/Event.php b/crates/shirabe-php-rpc/php/stubs/Composer/EventDispatcher/Event.php new file mode 100644 index 00000000..9ce9c12f --- /dev/null +++ b/crates/shirabe-php-rpc/php/stubs/Composer/EventDispatcher/Event.php @@ -0,0 +1,59 @@ +<?php + +// Hand-written proxy stub for Composer\EventDispatcher\Event, kept in the shape the future stub +// generator will output: the real public methods, each forwarding to the Rust-side entity. + +namespace Composer\EventDispatcher; + +class Event implements \ShirabeRustStub +{ + /** @var int */ + protected $__rhandle; + /** @var int */ + protected $__epoch; + + public function __construct(int $rhandle, int $epoch) + { + $this->__rhandle = $rhandle; + $this->__epoch = $epoch; + } + + public function __destruct() + { + \ShirabeRustObjectRegistry::release($this->__rhandle); + } + + public function __shirabeRustHandleDescriptor(): array + { + return [ + '__rhandle' => $this->__rhandle, + '__class' => static::class, + '__epoch' => $this->__epoch, + ]; + } + + public function getName(): string + { + return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getName', []); + } + + public function getArguments(): array + { + return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getArguments', []); + } + + public function getFlags(): array + { + return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getFlags', []); + } + + public function isPropagationStopped(): bool + { + return \ShirabeRpcRuntime::callRust($this->__rhandle, 'isPropagationStopped', []); + } + + public function stopPropagation(): void + { + \ShirabeRpcRuntime::callRust($this->__rhandle, 'stopPropagation', []); + } +} diff --git a/crates/shirabe-php-rpc/php/stubs/Composer/Script/Event.php b/crates/shirabe-php-rpc/php/stubs/Composer/Script/Event.php new file mode 100644 index 00000000..80afe1b7 --- /dev/null +++ b/crates/shirabe-php-rpc/php/stubs/Composer/Script/Event.php @@ -0,0 +1,37 @@ +<?php + +// Hand-written proxy stub for Composer\Script\Event, kept in the shape the future stub +// generator will output. See Composer/EventDispatcher/Event.php. + +namespace Composer\Script; + +use Composer\EventDispatcher\Event as BaseEvent; + +class Event extends BaseEvent +{ + public function getComposer(): \Composer\Composer + { + return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getComposer', []); + } + + public function getIO(): \Composer\IO\IOInterface + { + return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getIO', []); + } + + public function isDevMode(): bool + { + return \ShirabeRpcRuntime::callRust($this->__rhandle, 'isDevMode', []); + } + + public function getOriginatingEvent(): ?BaseEvent + { + return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getOriginatingEvent', []); + } + + public function setOriginatingEvent(BaseEvent $event): self + { + \ShirabeRpcRuntime::callRust($this->__rhandle, 'setOriginatingEvent', [$event]); + return $this; + } +} |
