for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <[email protected]>
* Dariusz Rumiński <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Etrias\EwarehousingConnector\Serializer;
use JMS\Serializer\DeserializationContext;
use JMS\Serializer\SerializerInterface;
use Psr\Http\Message\ResponseInterface;
trait ServiceTrait
{
/**
* @var SerializerInterface
protected $serializer;
* @param ResponseInterface $response
* @param string $className
* @param DeserializationContext $context
* @return mixed
protected function deserializeResponse(ResponseInterface $response, $className, DeserializationContext $context = null)
$content = (string) $response->getBody();
return $this->serializer->deserialize(
$content,
$className,
'json',
$context
);
}