Skip to content

Convert all data object fields to JSON strings. #991

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

Merged

Conversation

noplanman
Copy link
Member

? !
Type improvement
BC Break no

Summary

Converts any objects that have been passed to request methods to a JSON string.

This makes it possible to pass native objects directly in requests, for example (using Request::setChatPermissions from Bot API 4.4):

Request::setChatPermissions([
    'chat_id'     => '<chat_id>',
    'permissions' => new ChatPermissions([
        'can_send_messages' => true,
        'can_send_polls'    => true,
        'can_change_info'   => true,
    ]),
]);

@noplanman noplanman self-assigned this Aug 3, 2019
@noplanman noplanman requested a review from a team August 3, 2019 01:31
Copy link
Collaborator

@jacklul jacklul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@noplanman noplanman merged commit 75fc62e into php-telegram-bot:develop Aug 10, 2019
@noplanman noplanman deleted the allow_native_data_objects branch August 13, 2019 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants