Skip to content

Commit cd17e93

Browse files
committed
Changed private static array-properties to const
1 parent 003b6e0 commit cd17e93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Cookie.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Cookie
2222
* Handles dates as defined by RFC 2616 section 3.3.1, and also some other
2323
* non-standard, but common formats.
2424
*/
25-
private static $dateFormats = [
25+
private const DATE_FORMATS = [
2626
'D, d M Y H:i:s T',
2727
'D, d-M-y H:i:s T',
2828
'D, d-M-Y H:i:s T',
@@ -92,7 +92,7 @@ public function __toString()
9292

9393
if (null !== $this->expires) {
9494
$dateTime = \DateTime::createFromFormat('U', $this->expires, new \DateTimeZone('GMT'));
95-
$cookie .= '; expires='.str_replace('+0000', '', $dateTime->format(self::$dateFormats[0]));
95+
$cookie .= '; expires='.str_replace('+0000', '', $dateTime->format(self::DATE_FORMATS[0]));
9696
}
9797

9898
if ('' !== $this->domain) {
@@ -208,7 +208,7 @@ private static function parseDate(string $dateValue): ?string
208208
$dateValue = substr($dateValue, 1, -1);
209209
}
210210

211-
foreach (self::$dateFormats as $dateFormat) {
211+
foreach (self::DATE_FORMATS as $dateFormat) {
212212
if (false !== $date = \DateTime::createFromFormat($dateFormat, $dateValue, new \DateTimeZone('GMT'))) {
213213
return $date->format('U');
214214
}

0 commit comments

Comments
 (0)