-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathContext.php
142 lines (109 loc) · 3.33 KB
/
Context.php
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
namespace Swaggest\JsonSchema;
class Context extends MagicMap
{
const DEFAULT_MAX_NEST = 200;
public $import = true;
/** @var DataPreProcessor */
public $dataPreProcessor;
/** @var RefResolver */
public $refResolver;
/** @var RemoteRefProvider|null */
public $remoteRefProvider;
/** @var bool Skip result mapping, only validate data */
public $validateOnly = false;
/** @var bool Apply default values */
public $applyDefaults = true;
/** @var \SplObjectStorage */
public $circularReferences;
/** @var bool */
public $skipValidation = false;
/** @var string[]|null map of from -> to class names */
public $objectItemClassMapping;
/** @var bool allow soft cast from to/strings */
public $tolerateStrings = false;
/** @var bool do not tolerate special symbols even if base64_decode accepts string */
public $strictBase64Validation = false;
/** @var bool pack/unpack application/json in string content */
public $unpackContentMediaType = true;
/** @var \SplObjectStorage optional schemas cache */
public $schemasCache;
/** @var string property mapping set name */
public $mapping = Schema::DEFAULT_MAPPING;
public $version = Schema::VERSION_AUTO;
public $exportedDefinitions = [];
public $isRef = false;
/** @var int property max recursive nesting depth */
public $maxNestLevel = self::DEFAULT_MAX_NEST;
/**
* Dereference $ref unless there is a $ref property defined with format not equal to `uri-reference`.
* Default JSON Schema behavior is to dereference only if there is a $ref property defined with format
* equal to `uri-reference`.
*
* @var bool
*/
public $dereference = false;
/**
* @param boolean $skipValidation
* @return Context
*/
public function setSkipValidation($skipValidation = true)
{
$this->skipValidation = $skipValidation;
return $this;
}
/**
* ProcessingOptions constructor.
* @param RemoteRefProvider $remoteRefProvider
*/
public function __construct(?RemoteRefProvider $remoteRefProvider = null)
{
$this->remoteRefProvider = $remoteRefProvider;
}
/**
* @return DataPreProcessor
*/
public function getDataPreProcessor()
{
return $this->dataPreProcessor;
}
/**
* @param DataPreProcessor $dataPreProcessor
* @return Context
*/
public function setDataPreProcessor($dataPreProcessor)
{
$this->dataPreProcessor = $dataPreProcessor;
return $this;
}
/**
* @return RemoteRefProvider|null
*/
public function getRemoteRefProvider()
{
return $this->remoteRefProvider;
}
/**
* @param RemoteRefProvider $remoteRefProvider
* @return Context
*/
public function setRemoteRefProvider($remoteRefProvider)
{
$this->remoteRefProvider = $remoteRefProvider;
return $this;
}
/** @var self */
private $withDefault;
/**
* @return Context
*/
public function withDefault()
{
if (null === $this->withDefault) {
$this->withDefault = clone $this;
$this->withDefault->skipValidation = true;
$this->withDefault->applyDefaults = false;
}
return $this->withDefault;
}
}