File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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 ) {
@@ -205,7 +205,7 @@ private static function parseDate(string $dateValue): ?string
205205 $ dateValue = substr ($ dateValue , 1 , -1 );
206206 }
207207
208- foreach (self ::$ dateFormats as $ dateFormat ) {
208+ foreach (self ::DATE_FORMATS as $ dateFormat ) {
209209 if (false !== $ date = \DateTime::createFromFormat ($ dateFormat , $ dateValue , new \DateTimeZone ('GMT ' ))) {
210210 return $ date ->format ('U ' );
211211 }
You can’t perform that action at this time.
0 commit comments