| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; |
| 13 |
|
| 14 |
use Symfony\Component\Cache\Marshaller\MarshallerInterface; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
class IdentityMarshaller implements MarshallerInterface |
| 20 |
{ |
| 21 |
public function marshall(array $values, ?array &$failed): array |
| 22 |
{ |
| 23 |
foreach ($values as $key => $value) { |
| 24 |
if (!\is_string($value)) { |
| 25 |
throw new \LogicException(\sprintf('%s accepts only string as data.', __METHOD__)); |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
return $values; |
| 30 |
} |
| 31 |
|
| 32 |
public function unmarshall(string $value): string |
| 33 |
{ |
| 34 |
return $value; |
| 35 |
} |
| 36 |
} |