Repository navigation
Expand file tree
/
Copy pathSerializerContextBuilderInterface.php
More file actions
76 lines (69 loc) · 2.26 KB
/
Copy pathSerializerContextBuilderInterface.php
File metadata and controls
76 lines (69 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace ApiPlatform\State;
use ApiPlatform\Metadata\Exception\RuntimeException;
use ApiPlatform\Metadata\HttpOperation;
use Symfony\Component\HttpFoundation\Request;
/**
* Builds the context used by the Symfony Serializer.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
interface SerializerContextBuilderInterface
{
// @see ApiPlatform\Symfony\Controller\MainController and ApiPlatform\State\Provider\DeserializerProvider
public const ASSIGN_OBJECT_TO_POPULATE = 'api_assign_object_to_populate';
/**
* The class of the resource a PUT replaces, set by ApiPlatform\State\Provider\DeserializeProvider.
*
* @internal
*/
public const REPLACED_CLASS = 'api_replaced_class';
/**
* Creates a serialization context from a Request.
*
* @param array<string, mixed>|null $extractedAttributes
*
* @throws RuntimeException
*
* @return array<string, mixed>
*
* @phpstan-return array<string, mixed>
*
* @psalm-return array{
* groups?: string[]|string,
* operation_name?: string,
* operation?: HttpOperation,
* resource_class?: class-string,
* skip_null_values?: bool,
* iri_only?: bool,
* request_uri?: string,
* uri?: string,
* input?: array{class: class-string|null},
* output?: array{class: class-string|null},
* item_uri_template?: string,
* types?: string[],
* uri_variables?: array<string, string>,
* force_resource_class?: class-string,
* api_allow_update?: bool,
* deep_object_to_populate?: bool,
* api_merge_patch_maps?: bool,
* collect_denormalization_errors?: bool,
* exclude_from_cache_key?: string[],
* api_included?: bool,
* attributes?: string[],
* deserializer_type?: string,
* api_assign_object_to_populate?: bool,
* ...<string, mixed>
* }
*/
public function createFromRequest(Request $request, bool $normalization, ?array $extractedAttributes = null): array;
}