%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/sentry/sentry/src/Serializer/ |
Upload File : |
<?php
declare(strict_types=1);
namespace Sentry\Serializer;
/**
* Serializes a value into a representation that should reasonably suggest
* both the type and value, and be serializable into JSON.
*/
class RepresentationSerializer extends AbstractSerializer implements RepresentationSerializerInterface
{
/**
* {@inheritdoc}
*/
public function representationSerialize($value)
{
$value = $this->serializeRecursively($value);
if (is_numeric($value)) {
return (string) $value;
}
if (\is_bool($value)) {
return $value ? 'true' : 'false';
}
return $value;
}
/**
* This method is overridden to return even basic types as strings.
*
* @param mixed $value The value that needs to be serialized
*
* @return string
*/
protected function serializeValue($value)
{
if (null === $value) {
return 'null';
}
if (false === $value) {
return 'false';
}
if (true === $value) {
return 'true';
}
if (\is_float($value) && (int) $value == $value) {
return $value . '.0';
}
if (is_numeric($value)) {
return (string) $value;
}
return (string) parent::serializeValue($value);
}
}