Skip to content

Commit

Permalink
adds more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schmittjoh committed Feb 22, 2013
1 parent ffb2d5d commit 9a50b15
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 15 additions & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ From 0.11 to 0.12
=================

- GraphNavigator::detachObject has been removed, you can directly use Context::stopVisiting instead.
- VisitorInterface::getNavigator was deprecated, instead use Context::accept
- VisitorInterface::getNavigator was deprecated, instead use Context::accept
- Serializer::setGroups, Serializer::setExclusionStrategy and Serializer::setVersion were removed, these settings must
now be passed as part of a new Context object.

Before:

$serializer->setVersion(1);
$serializer->serialize($data, 'json');

After:

$serializer->serialize($data, 'json', Context::create()->setVersion(1));

- All visit??? methods of the VisitorInterface, now require a third argument, the Context; the context is for example
passed as an additional argument to handler, exclusion strategies, and also available in event listeners.
6 changes: 4 additions & 2 deletions src/JMS/Serializer/SerializerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ interface SerializerInterface
*
* @param object|array|scalar $data
* @param string $format
* @param Context $context
*
* @return string
*/
public function serialize($data, $format);
public function serialize($data, $format, Context $context = null);

/**
* Deserializes the given data to the specified type.
*
* @param string $data
* @param string $type
* @param string $format
* @param Context $context
*
* @return object|array|scalar
*/
public function deserialize($data, $type, $format);
public function deserialize($data, $type, $format, Context $context = null);
}

0 comments on commit 9a50b15

Please sign in to comment.