for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the xAPI package.
*
* (c) Christian Flothmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Xabbuh\XApi\Serializer\Handler;
use JMS\Serializer\Context;
use JMS\Serializer\GraphNavigator;
use JMS\Serializer\Handler\SubscribingHandlerInterface;
use JMS\Serializer\JsonSerializationVisitor;
use Xabbuh\XApi\Model\DocumentData;
/**
* Unwraps the data of an xAPI document during the serialization process.
* @author Christian Flothmann <[email protected]>
class DocumentDataUnwrapper implements SubscribingHandlerInterface
{
* {@inheritDoc}
public static function getSubscribingMethods()
return array(array(
'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
'format' => 'json',
'type' => 'Xabbuh\XApi\Model\DocumentData',
'method' => 'unwrapData',
));
}
public function unwrapData(JsonSerializationVisitor $visitor, DocumentData $document, array $type, Context $context)
$type
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$context
$visitor->setRoot($document->getData());
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.