~ballot/wordpress/openstack-objectstorage-breaking-insight

« back to all changes in this revision

Viewing changes to vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php

  • Committer: Thomas Cuthbert
  • Date: 2020-04-23 05:22:45 UTC
  • Revision ID: thomas.cuthbert@canonical.com-20200423052245-1jxao3mw31w435js
[,r=trivial] bionic composer vendor update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
 
3
2
namespace GuzzleHttp\Cookie;
4
3
 
5
4
use GuzzleHttp\ToArrayInterface;
120
119
     * Set the cookie name
121
120
     *
122
121
     * @param string $name Cookie name
123
 
     *
124
 
     * @return self
125
122
     */
126
123
    public function setName($name)
127
124
    {
128
125
        $this->data['Name'] = $name;
129
 
 
130
 
        return $this;
131
126
    }
132
127
 
133
128
    /**
144
139
     * Set the cookie value
145
140
     *
146
141
     * @param string $value Cookie value
147
 
     *
148
 
     * @return self
149
142
     */
150
143
    public function setValue($value)
151
144
    {
152
145
        $this->data['Value'] = $value;
153
 
 
154
 
        return $this;
155
146
    }
156
147
 
157
148
    /**
168
159
     * Set the domain of the cookie
169
160
     *
170
161
     * @param string $domain
171
 
     *
172
 
     * @return self
173
162
     */
174
163
    public function setDomain($domain)
175
164
    {
176
165
        $this->data['Domain'] = $domain;
177
 
 
178
 
        return $this;
179
166
    }
180
167
 
181
168
    /**
192
179
     * Set the path of the cookie
193
180
     *
194
181
     * @param string $path Path of the cookie
195
 
     *
196
 
     * @return self
197
182
     */
198
183
    public function setPath($path)
199
184
    {
200
185
        $this->data['Path'] = $path;
201
 
 
202
 
        return $this;
203
186
    }
204
187
 
205
188
    /**
216
199
     * Set the max-age of the cookie
217
200
     *
218
201
     * @param int $maxAge Max age of the cookie in seconds
219
 
     *
220
 
     * @return self
221
202
     */
222
203
    public function setMaxAge($maxAge)
223
204
    {
224
205
        $this->data['Max-Age'] = $maxAge;
225
 
 
226
 
        return $this;
227
206
    }
228
207
 
229
208
    /**
240
219
     * Set the unix timestamp for which the cookie will expire
241
220
     *
242
221
     * @param int $timestamp Unix timestamp
243
 
     *
244
 
     * @return self
245
222
     */
246
223
    public function setExpires($timestamp)
247
224
    {
248
225
        $this->data['Expires'] = is_numeric($timestamp)
249
226
            ? (int) $timestamp
250
227
            : strtotime($timestamp);
251
 
 
252
 
        return $this;
253
228
    }
254
229
 
255
230
    /**
266
241
     * Set whether or not the cookie is secure
267
242
     *
268
243
     * @param bool $secure Set to true or false if secure
269
 
     *
270
 
     * @return self
271
244
     */
272
245
    public function setSecure($secure)
273
246
    {
274
247
        $this->data['Secure'] = $secure;
275
 
 
276
 
        return $this;
277
248
    }
278
249
 
279
250
    /**
290
261
     * Set whether or not this is a session cookie
291
262
     *
292
263
     * @param bool $discard Set to true or false if this is a session cookie
293
 
     *
294
 
     * @return self
295
264
     */
296
265
    public function setDiscard($discard)
297
266
    {
298
267
        $this->data['Discard'] = $discard;
299
 
 
300
 
        return $this;
301
268
    }
302
269
 
303
270
    /**
314
281
     * Set whether or not this is an HTTP only cookie
315
282
     *
316
283
     * @param bool $httpOnly Set to true or false if this is HTTP only
317
 
     *
318
 
     * @return self
319
284
     */
320
285
    public function setHttpOnly($httpOnly)
321
286
    {
322
287
        $this->data['HttpOnly'] = $httpOnly;
323
 
 
324
 
        return $this;
325
288
    }
326
289
 
327
290
    /**