Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
namespace Aws\DynamoDb;
3
 
4
use GuzzleHttp\Psr7;
5
 
6
/**
7
 * Special object to represent a DynamoDB binary (B) value.
8
 */
9
class BinaryValue implements \JsonSerializable
10
{
11
    /** @var string Binary value. */
12
    private $value;
13
 
14
    /**
15
     * @param mixed $value A binary value compatible with Guzzle streams.
16
     *
17
     * @see GuzzleHttp\Stream\Stream::factory
18
     */
19
    public function __construct($value)
20
    {
21
        if (!is_string($value)) {
22
            $value = Psr7\Utils::streamFor($value);
23
        }
24
        $this->value = (string) $value;
25
    }
26
 
27
    #[\ReturnTypeWillChange]
28
    public function jsonSerialize()
29
    {
30
        return $this->value;
31
    }
32
 
33
    public function __toString()
34
    {
35
        return $this->value;
36
    }
37
}