From cd952205142fe39808bb92bce4fccc577140bddd Mon Sep 17 00:00:00 2001 From: oatmael <45870261+oatmael@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:02:40 +0930 Subject: [PATCH] Remove PHP 8.0 syntax --- src/LibExtism.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/LibExtism.php b/src/LibExtism.php index cc4b5dc..3937218 100644 --- a/src/LibExtism.php +++ b/src/LibExtism.php @@ -72,7 +72,7 @@ function extism_current_plugin_memory_length(FFI\CData $plugin, int $offset): in return $this->ffi->extism_current_plugin_memory_length($plugin, $offset); } - function extism_plugin_new(string $wasm, int $wasm_size, FFI\CData $functions, int $n_functions, bool $with_wasi, ?FFI\CData $errmsg): FFI\CData|null + function extism_plugin_new(string $wasm, int $wasm_size, FFI\CData $functions, int $n_functions, bool $with_wasi, ?FFI\CData $errmsg): ?FFI\CData { $ptr = $this->owned("uint8_t", $wasm); $wasi = $with_wasi ? 1 : 0; @@ -154,7 +154,7 @@ function extism_function_set_namespace(FFI\CData $handle, string $name) $this->ffi->extism_function_set_namespace($handle, $namePtr); } - function toCArray(array $array, string $type): FFI\CData | null + function toCArray(array $array, string $type): ?FFI\CData { if (count($array) == 0) { return $this->ffi->new($type . "*"); @@ -168,7 +168,7 @@ function toCArray(array $array, string $type): FFI\CData | null return $cArray; } - function owned(string $type, string $string): FFI\CData|null + function owned(string $type, string $string): ?FFI\CData { if (strlen($string) == 0) { return null; @@ -179,7 +179,7 @@ function owned(string $type, string $string): FFI\CData|null return $str; } - function ownedZero(string $string): FFI\CData|null + function ownedZero(string $string): ?FFI\CData { return $this->owned("char", "$string\0"); } @@ -189,4 +189,4 @@ function startsWith($haystack, $needle) { } } -?> \ No newline at end of file +?>