for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Lej\Component\Infrastructure\Serialization;
use JMS\Serializer\GraphNavigator;
use JMS\Serializer\Handler\SubscribingHandlerInterface;
use JMS\Serializer\VisitorInterface;
use Lej\Component\Domain\Model\Id;
class IdSubscribingHandler implements SubscribingHandlerInterface
{
/**
* {@inheritdoc}
*/
public static function getSubscribingMethods()
$methods = [];
$formats = ['json'];
foreach ($formats as $format) {
$methods[] = [
'type' => 'Id',
'format' => $format,
'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
'method' => 'serializeId',
];
}
return $methods;
* @param VisitorInterface $visitor
* @param Id $id
* @return string
public function serializeId(VisitorInterface $visitor, Id $id)
$visitor
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return $id->toString();
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.