Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@..
Decoded Output download
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Serializer\Tests\Fixtures;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* @author Karoly Gossler <[email protected]>
*/
class EnvelopeNormalizer implements NormalizerInterface
{
private $serializer;
public function normalize($envelope, ?string $format = null, array $context = []): array
{
$xmlContent = $this->serializer->serialize($envelope->message, 'xml');
$encodedContent = base64_encode($xmlContent);
return [
'message' => $encodedContent,
];
}
public function getSupportedTypes(?string $format): array
{
return [
EnvelopeObject::class => true,
];
}
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
{
return $data instanceof EnvelopeObject;
}
public function setSerializer($serializer): void
{
$this->serializer = $serializer;
}
}
?>
Did this file decode correctly?
Original Code
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Serializer\Tests\Fixtures;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* @author Karoly Gossler <[email protected]>
*/
class EnvelopeNormalizer implements NormalizerInterface
{
private $serializer;
public function normalize($envelope, ?string $format = null, array $context = []): array
{
$xmlContent = $this->serializer->serialize($envelope->message, 'xml');
$encodedContent = base64_encode($xmlContent);
return [
'message' => $encodedContent,
];
}
public function getSupportedTypes(?string $format): array
{
return [
EnvelopeObject::class => true,
];
}
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
{
return $data instanceof EnvelopeObject;
}
public function setSerializer($serializer): void
{
$this->serializer = $serializer;
}
}
Function Calls
None |
Stats
MD5 | 8f19aa5c812df700d24ce763df7dd322 |
Eval Count | 0 |
Decode Time | 78 ms |