maximegosselin/serializer · ArrayDeserializeStrategy.php
php logo
public function deserialize(array $data)
    {
        $this->assertValidData($data);

        $payload = $data['payload'];
        $deserializer = $this->deserializer;
        array_walk($payload, function (&$value) use ($deserializer) {
            $value = $deserializer->deserialize($value);
        });

        return $payload;
    }
Similar code snippets
1.
martyn82/apha · SagaSerializer.php
Match rating: 73.51% · See similar code snippets
php logo
public function deserialize(string $data, string $type)
    {
        /* @var $deserialized Saga */
        $deserialized = $this->serializer->deserialize($data, $type);
        $this->factory->hydrate($deserialized);
        return $deserialized;
    }
2.
maximegosselin/serializer · Engine.php
Match rating: 71.35% · See similar code snippets
php logo
public function deserialize(array $data)
    {
        /** @var DeserializeStrategyInterface $strategy */
        foreach ($this->deserializeStrategies as $strategy) {
            if ($strategy->canDeserialize($data)) {
                return $strategy->deserialize($data);
            }
        }

        throw new DeserializationException('Could not deserialize data.');
    }
3.
infomaniac-amf/php · AMF.php
Match rating: 71.33% · See similar code snippets
php logo
public static function deserialize($data, $forceType = null)
    {
        try {
            self::init();

            $stream       = new Input($data);
            $deserializer = new Deserializer($stream);

            return $deserializer->deserialize($forceType);
        } catch (Exception $e) {
            $ex = new DeserializationException($e->getMessage(), $e->getCode(), $e);
            $ex->setData($data);
            throw $ex;
        }
    }
4.
ProjetPP/PPP-datamodel-PHP · AbstractReducerNodeDeserializer.php
Match rating: 70.08% · See similar code snippets
php logo
public function deserialize($serialization) {
		$this->assertCanDeserialize($serialization);
		$this->requireAttribute($serialization, 'list');
		$nodeDeserializer = $this->deserializerFactory->newNodeDeserializer();

		return $this->getDeserialization($nodeDeserializer->deserialize($serialization['list']));
	}
5.
eosnewmedia/ShopwareSdk · EntryPoint.php
Match rating: 69.47% · See similar code snippets
php logo
public function addDeserializer(JsonDeserializerInterface $deserializer): EntryPoint
    {
        foreach ($deserializer->getSupportedTypes() as $type) {
            $this->deserializers[$type] = $deserializer;
        }

        return $this;
    }
6.
24HOURSMEDIA/tesla-esync · SqsNotificationReceiver.php
Match rating: 69.41% · See similar code snippets
php logo
function getDeserializer()
    {
        if (!$this->deserializer) {
            $this->deserializer = new JsonMessageDeserializer($this->getMessageFactory());
        }

        return $this->deserializer;
    }
7.
ProjetPP/PPP-datamodel-PHP · DeserializerFactory.php
Match rating: 69.11% · See similar code snippets
php logo
private function buildNodeDeserializer(array $customResourceNodesDeserializers) {
		$resourceNodeDeserializer = $this->buildResourceNodeDeserializer($customResourceNodesDeserializers);
		return new DispatchingDeserializer(array(
			new MissingNodeDeserializer(),
			new TripleNodeDeserializer($this),
			new UnionNodeDeserializer($this),
			new IntersectionNodeDeserializer($this),
			new FirstNodeDeserializer($this),
			new LastNodeDeserializer($this),
			new SentenceNodeDeserializer(),
			new SortNodeDeserializer($this, $resourceNodeDeserializer),
			new ResourceListNodeDeserializer($resourceNodeDeserializer),
			new ResourceAsResourceListNodeDeserializer($resourceNodeDeserializer)
		));
	}
8.
JurJean/SpraySerializer · BoundClosureSerializer.php
Match rating: 68.95% · See similar code snippets
php logo
protected function deserializer()
    {
        if (null === $this->deserializer) {
            $self = $this;
            $this->deserializer = Closure::bind($this->bindDeserializer(), null, $this->class);
        }
        return $this->deserializer;
    }
9.
chemisus/provider · JsonSerializer.php
Match rating: 68.81% · See similar code snippets
php logo
public function deserialize($string)
    {
        return json_decode($string, $this->deserializeAssoc, $this->deserializeDepth, $this->deserializeOptions);
    }
10.
maximegosselin/serializer · ObjectDeserializeStrategy.php
Match rating: 68.8% · See similar code snippets
php logo
public function deserialize(array $data)
    {
        $this->assertValidData($data);

        $class = $data['class'];
        $payload = $data['payload'];

        if (!class_exists($class)) {
            throw new InvalidArgumentException(sprintf('Class %s not found.', $class));
        }

        if (!in_array(DeserializableInterface::class, class_implements($class))) {
            throw new InvalidArgumentException(sprintf(
                'Class %s must implement %s.',
                $class,
                DeserializableInterface::class
            ));
        }

        array_walk($payload, function (&$value) {
            $value = $this->deserializer->deserialize($value);
        });

        return forward_static_call([$class, 'deserialize'], $payload);
    }