Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of the Symfony package.
5
 *
6
 * (c) Fabien Potencier <fabien@symfony.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
13
 
14
use Symfony\Component\Cache\Marshaller\MarshallerInterface;
15
 
16
/**
17
 * @author Ahmed TAILOULOUTE <ahmed.tailouloute@gmail.com>
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
}