All Downloads are FREE. Search and download functionalities are using the official Maven repository.

php-symfony.serialization.StrictJsonDeserializationVisitor.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
jsonDeserializationVisitor = new JsonDeserializationVisitor($options, $depth);
    }

    /**
     * {@inheritdoc}
     */
    public function visitNull($data, array $type) 
    {
        return $this->jsonDeserializationVisitor->visitNull($data, $type);
    }

    /**
     * {@inheritdoc}
     */
    public function visitString($data, array $type): string
    {
        if (!is_string($data)) {
            throw TypeMismatchException::fromValue('string', $data);
        }

        return $this->jsonDeserializationVisitor->visitString($data, $type);
    }

    /**
     * {@inheritdoc}
     */
    public function visitBoolean($data, array $type): bool
    {
        if (!is_bool($data)) {
            throw TypeMismatchException::fromValue('boolean', $data);
        }

        return $this->jsonDeserializationVisitor->visitBoolean($data, $type);
    }

    /**
     * {@inheritdoc}
     */
    public function visitInteger($data, array $type): int
    {
        if (!is_int($data)) {
            throw TypeMismatchException::fromValue('integer', $data);
        }

        return $this->jsonDeserializationVisitor->visitInteger($data, $type);
    }

    /**
     * {@inheritdoc}
     */
    public function visitDouble($data, array $type): float
    {
        if (!is_float($data) && !is_integer($data)) {
            throw TypeMismatchException::fromValue('double', $data);
        }

        return $this->jsonDeserializationVisitor->visitDouble($data, $type);
    }

    /**
     * {@inheritdoc}
     */
    public function visitArray($data, array $type): array
    {
        return $this->jsonDeserializationVisitor->visitArray($data, $type);
    }

    /**
     * {@inheritdoc}
     */
    public function visitDiscriminatorMapProperty($data, ClassMetadata $metadata): string
    {
        return $this->jsonDeserializationVisitor->visitDiscriminatorMapProperty($data, $metadata);
    }

    /**
     * {@inheritdoc}
     */
    public function startVisitingObject(ClassMetadata $metadata, object $data, array $type): void
    {
        $this->jsonDeserializationVisitor->startVisitingObject($metadata, $data, $type);
    }

    /**
     * {@inheritdoc}
     */
    public function visitProperty(PropertyMetadata $metadata, $data)
    {
        return $this->jsonDeserializationVisitor->visitProperty($metadata, $data);
    }

    /**
     * {@inheritdoc}
     */
    public function endVisitingObject(ClassMetadata $metadata, $data, array $type): object
    {
        return $this->jsonDeserializationVisitor->endVisitingObject($metadata, $data, $type);
    }

    /**
     * {@inheritdoc}
     */
    public function getResult($data)
    {
        return $this->jsonDeserializationVisitor->getResult($data);
    }

    /**
     * {@inheritdoc}
     */
    public function prepare($data)
    {
        return $this->jsonDeserializationVisitor->prepare($data);
    }
    
    /**
     * {@inheritdoc}
     */
    public function setNavigator(GraphNavigatorInterface $navigator): void
    {
        $this->jsonDeserializationVisitor->setNavigator($navigator);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy