Skip to content

Add PHP stub file #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions msgpack-stub.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

class MessagePack {

public const OPT_PHPONLY = -1001;
public const OPT_ASSOC = -1002;

public function __construct(bool $phponly = false) {}

public function pack(mixed $data): string {}

public function setOption(int $option, mixed $value): bool {}

public function unpack(string $serialized): mixed {}

public function unpacker(): MessagePackUnpacker {}
}

class MessagePackUnpacker {

public function __construct(bool $phponly = false) {}

public function __destruct() {}

public function data(string|object|null $object = null): mixed {}

public function execute(int|float|null $offset = null): bool {}

public function feed(string $chunk): bool {}

public function reset(): void {}

public function setOption(int $option, mixed $value): bool {}
}

function msgpack_serialize(mixed $value): string {}

/**
* alias for msgpack_serialize()
*/
function msgpack_pack(mixed $value): string {}

function msgpack_unserialize(string $str): mixed {}

/**
* alias for msgpack_unserialize()
*/
function msgpack_unpack(string $str): mixed {}