1 | <?php |
||
29 | class CorsOptions extends AbstractOptions |
||
30 | { |
||
31 | const ROUTE_PARAM = 'cors'; |
||
32 | |||
33 | /** |
||
34 | * Set the list of allowed origins domain with protocol. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $allowedOrigins = []; |
||
39 | |||
40 | /** |
||
41 | * Set the list of HTTP verbs. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $allowedMethods = []; |
||
46 | |||
47 | /** |
||
48 | * Set the list of headers. |
||
49 | * |
||
50 | * @var array |
||
51 | */ |
||
52 | protected $allowedHeaders = []; |
||
53 | |||
54 | /** |
||
55 | * Set the max age of the authorize request in seconds. |
||
56 | * |
||
57 | * @var int |
||
58 | */ |
||
59 | protected $maxAge = 0; |
||
60 | |||
61 | /** |
||
62 | * Set the list of exposed headers. |
||
63 | * |
||
64 | * @var array |
||
65 | */ |
||
66 | protected $exposedHeaders = []; |
||
67 | |||
68 | /** |
||
69 | * Allow CORS request with credential. |
||
70 | * |
||
71 | * @var bool |
||
72 | */ |
||
73 | protected $allowedCredentials = false; |
||
74 | |||
75 | /** |
||
76 | * @param array $allowedOrigins |
||
77 | * @return void |
||
78 | */ |
||
79 | public function setAllowedOrigins(array $allowedOrigins) |
||
83 | |||
84 | /** |
||
85 | * @return array |
||
86 | */ |
||
87 | public function getAllowedOrigins() |
||
91 | |||
92 | /** |
||
93 | * @param array $allowedMethods |
||
94 | * @return void |
||
95 | */ |
||
96 | public function setAllowedMethods(array $allowedMethods) |
||
104 | |||
105 | /** |
||
106 | * @return array |
||
107 | */ |
||
108 | public function getAllowedMethods() |
||
112 | |||
113 | /** |
||
114 | * @param array $allowedHeaders |
||
115 | * @return void |
||
116 | */ |
||
117 | public function setAllowedHeaders(array $allowedHeaders) |
||
121 | |||
122 | /** |
||
123 | * @return array |
||
124 | */ |
||
125 | public function getAllowedHeaders() |
||
129 | |||
130 | /** |
||
131 | * @param int $maxAge |
||
132 | * @return void |
||
133 | */ |
||
134 | public function setMaxAge($maxAge) |
||
138 | |||
139 | /** |
||
140 | * @return int |
||
141 | */ |
||
142 | public function getMaxAge() |
||
146 | |||
147 | /** |
||
148 | * @param array $exposedHeaders |
||
149 | * @return void |
||
150 | */ |
||
151 | public function setExposedHeaders(array $exposedHeaders) |
||
155 | |||
156 | /** |
||
157 | * @return array |
||
158 | */ |
||
159 | public function getExposedHeaders() |
||
163 | |||
164 | /** |
||
165 | * @param bool $allowedCredentials |
||
166 | * @return void |
||
167 | */ |
||
168 | public function setAllowedCredentials($allowedCredentials) |
||
172 | |||
173 | /** |
||
174 | * @return boolean |
||
175 | */ |
||
176 | public function getAllowedCredentials() |
||
180 | } |
||
181 |