Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Latest commit

 

History

History
39 lines (25 loc) · 1.04 KB

DenormalizerObjectMappingRegistryFactory.md

File metadata and controls

39 lines (25 loc) · 1.04 KB

DenormalizerObjectMappingRegistryFactory

without name (default)

<?php

use Chubbyphp\Deserialization\Mapping\DenormalizationObjectMappingInterface;
use Chubbyphp\Deserialization\ServiceFactory\DenormalizerObjectMappingRegistryFactory;
use Psr\Container\ContainerInterface;

/** @var ContainerInterface $container */
$container = ...;

// $container->get(DenormalizationObjectMappingInterface::class.'[]')

$factory = new DenormalizerObjectMappingRegistryFactory();

$denormalizerObjectMappingRegistry = $factory($container);

with name default

<?php

use Chubbyphp\Deserialization\Mapping\DenormalizationObjectMappingInterface;
use Chubbyphp\Deserialization\ServiceFactory\DenormalizerObjectMappingRegistryFactory;
use Psr\Container\ContainerInterface;

/** @var ContainerInterface $container */
$container = ...;

// $container->get(DenormalizationObjectMappingInterface::class.'[]default')

$factory = [DenormalizerObjectMappingRegistryFactory::class, 'default'];

$denormalizerObjectMappingRegistry = $factory($container);