Skip to content
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

Serializer and general bernard questions #407

Open
ninze opened this issue Dec 10, 2019 · 1 comment
Open

Serializer and general bernard questions #407

ninze opened this issue Dec 10, 2019 · 1 comment

Comments

@ninze
Copy link

ninze commented Dec 10, 2019

Hi,

I am new to this project and I am trying to figure out how message serialization works. I know the default place for questions is usually stack overflow, but currently it doesn't have a bernard tag and I had a feeling that I would need to wait a few months to get an answer there :)

Bernard installed from composer (currently v0.13) comes with Bernard\Serializer\SimpleSerializer class and suggests using symfony or JMS serializers instead. This doc says that currently bernard uses symfony serializer by default.

On the other hand I couldn't find symfony/serializer in composer.json. The Bernard\Serializer namespace is gone and Bernard/Serializer class seems to use json_encode / json_decode. To confuse things even more, Bernard/Serializer is an interface in the latest composer and a class in the latest master branch.

So I figured I should go read the docs again :) This doc says that if I plan to use a custom message class (which I do), then I must provide a normalizer for it. Except there is no such thing in the currently available composer version of bernard.

My questions are:

PHP native serialize() function should be able to handle simple classes like PlainMessage. Why does bernard need complex serializers from symfony or JMS even for the most basic message type?

It seems that 0.x branch (which is installed by default via composer) is many years behind the current master and current documentation is no longer usable for 0.x. Is it generally a good idea to use the current master instead?

@marufmax
Copy link

yea, having the same problem. The docs need to be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants