Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 402 Bytes

NormalizerContextBuilder.md

File metadata and controls

20 lines (14 loc) · 402 Bytes

NormalizerContextBuilder

<?php

use Chubbyphp\Serialization\Normalizer\NormalizerContextBuilder;
use Psr\Http\Message\ServerRequestInterface;

$request = ...;

$context = NormalizerContextBuilder::create()
    ->setRequest($request)
    ->setAttributes(['key' => 'value'])
    ->getContext();

print_r($context->getAttributes());
// ['key' => 'value']

$request = $context->getRequest();