Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixed type-hinting #586

Merged
merged 1 commit into from
Aug 12, 2016
Merged

Fixed type-hinting #586

merged 1 commit into from
Aug 12, 2016

Conversation

jgendera
Copy link
Contributor

No description provided.

@goetas
Copy link
Collaborator

goetas commented Jul 26, 2016

What is the advantage? Is it for some IDE support? which one?

@jgendera
Copy link
Contributor Author

Yes. When you create serialization subscriber, when adding data via Visitor, PHPStorm displays warnings. i.e. "Expected \JMS\Serializer\scalar, got string"

Example code:

public function onPostSerialize(ObjectEvent $event)
{
    $object = $event->getObject();
    $visitor = $event->getVisitor();
    $visitor->addData('url', 'http://example.com/' . $object->getFileName());
}

@goetas
Copy link
Collaborator

goetas commented Jul 29, 2016

👍

@goetas goetas added this to the v1.3 milestone Aug 9, 2016
@goetas goetas merged commit 6091d38 into schmittjoh:master Aug 12, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants