Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 593 Bytes

SerializerFactory.md

File metadata and controls

33 lines (21 loc) · 593 Bytes

SerializerFactory

without name (default)

<?php

use Chubbyphp\Serialization\ServiceFactory\SerializerFactory;
use Psr\Container\ContainerInterface;

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

$factory = new SerializerFactory();

$serializer = $factory($container);

with name default

<?php

use Chubbyphp\Serialization\ServiceFactory\SerializerFactory;
use Psr\Container\ContainerInterface;

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

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

$serializer = $factory($container);