Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 600 Bytes

DenormalizerContext.md

File metadata and controls

26 lines (18 loc) · 600 Bytes

DenormalizerContext

<?php

use Chubbyphp\Deserialization\Denormalizer\DenormalizerContext;
use Psr\Http\Message\ServerRequestInterface;

/** @var ServerRequestInterface $request */
$request = ...;

$context = new DenormalizerContext($request, ['key' => 'value'], ['allowed_additional_field'], true);

$context->getRequest();
// instanceof ServerRequestInterface

$context->getAttributes();
$context->getAttribute('name');
$context = $context->withAttribute('name');

echo $context->getAllowedAdditionalFields();
// ['allowed_additional_field']

echo $context->isClearMissing();
// true