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

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();