$43 GRAYBYTE WORDPRESS FILE MANAGER $97

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/php53/usr/share/pear/Symfony/Component/Serializer/Encoder/

HOME
Current File : /opt/alt/php53/usr/share/pear/Symfony/Component/Serializer/Encoder//ChainDecoder.php
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Serializer\Encoder;

use Symfony\Component\Serializer\Exception\RuntimeException;

/**
 * Decoder delegating the decoding to a chain of decoders.
 *
 * @author Jordi Boggiano <j.boggiano@seld.be>
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 * @author Lukas Kahwe Smith <smith@pooteeweet.org>
 */
class ChainDecoder implements DecoderInterface
{
    protected $decoders = array();
    protected $decoderByFormat = array();

    public function __construct(array $decoders = array())
    {
        $this->decoders = $decoders;
    }

    /**
     * {@inheritdoc}
     */
    final public function decode($data, $format, array $context = array())
    {
        return $this->getDecoder($format)->decode($data, $format, $context);
    }

    /**
     * {@inheritdoc}
     */
    public function supportsDecoding($format)
    {
        try {
            $this->getDecoder($format);
        } catch (RuntimeException $e) {
            return false;
        }

        return true;
    }

    /**
     * Gets the decoder supporting the format.
     *
     * @param string $format
     *
     * @return DecoderInterface
     * @throws RuntimeException if no decoder is found
     */
    private function getDecoder($format)
    {
        if (isset($this->decoderByFormat[$format])
            && isset($this->decoders[$this->decoderByFormat[$format]])
        ) {
            return $this->decoders[$this->decoderByFormat[$format]];
        }

        foreach ($this->decoders as $i => $decoder) {
            if ($decoder->supportsDecoding($format)) {
                $this->decoderByFormat[$format] = $i;

                return $decoder;
            }
        }

        throw new RuntimeException(sprintf('No decoder found for format "%s".', $format));
    }
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 7.05 AM
root / root
0755
ChainDecoder.php
1.985 KB
18 Dec 2019 6.20 PM
root / root
0644
ChainEncoder.php
2.468 KB
18 Dec 2019 6.20 PM
root / root
0644
DecoderInterface.php
1.188 KB
18 Dec 2019 6.20 PM
root / root
0644
EncoderInterface.php
0.926 KB
18 Dec 2019 6.20 PM
root / root
0644
JsonDecode.php
3.727 KB
18 Dec 2019 6.20 PM
root / root
0644
JsonEncode.php
1.602 KB
18 Dec 2019 6.20 PM
root / root
0644
JsonEncoder.php
1.865 KB
18 Dec 2019 6.20 PM
root / root
0644
NormalizationAwareInterface.php
0.601 KB
18 Dec 2019 6.20 PM
root / root
0644
SerializerAwareEncoder.php
0.746 KB
18 Dec 2019 6.20 PM
root / root
0644
XmlEncoder.php
13.487 KB
18 Dec 2019 6.20 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF