This repository was archived by the owner on Dec 31, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public function setValue(string ...$value) : self
7878 /**
7979 * Gets the header value
8080 *
81- * @return array<int, string>
81+ * @return list< string>
8282 */
8383 public function getValue () : array
8484 {
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public function setValue(string ...$value) : self
8181 /**
8282 * Gets the header value
8383 *
84- * @return array<int, string>
84+ * @return list< string>
8585 */
8686 public function getValue () : array
8787 {
Original file line number Diff line number Diff line change @@ -99,9 +99,12 @@ public function getFieldValue() : string
9999 return '* ' ;
100100 }
101101
102- $ value = $ uri ->getScheme () . ':// ' . $ uri ->getHost ();
103- if (null !== $ uri ->getPort ()) {
104- $ value .= ': ' . $ uri ->getPort ();
102+ $ value = $ uri ->getScheme () . ': ' ;
103+ $ value .= '// ' . $ uri ->getHost ();
104+
105+ $ port = $ uri ->getPort ();
106+ if (null !== $ port ) {
107+ $ value .= ': ' . $ port ;
105108 }
106109
107110 return $ value ;
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public function setValue(string ...$value) : self
7878 /**
7979 * Gets the header value
8080 *
81- * @return array <string>
81+ * @return list <string>
8282 */
8383 public function getValue () : array
8484 {
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public function setValue(string ...$value) : self
8181 /**
8282 * Gets the header value
8383 *
84- * @return array<int, string>
84+ * @return list< string>
8585 */
8686 public function getValue () : array
8787 {
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public function setValue(string ...$value) : self
7878 /**
7979 * Gets the header value
8080 *
81- * @return array<int, string>
81+ * @return list< string>
8282 */
8383 public function getValue () : array
8484 {
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public function setValue(string ...$value) : self
8787 /**
8888 * Gets the header value
8989 *
90- * @return array<int, string>
90+ * @return list< string>
9191 */
9292 public function getValue () : array
9393 {
Original file line number Diff line number Diff line change 1515 * Import classes
1616 */
1717use DateTime ;
18+ use DateTimeImmutable ;
1819use DateTimeInterface ;
1920use DateTimeZone ;
2021
@@ -81,8 +82,14 @@ public function getFieldName() : string
8182 */
8283 public function getFieldValue () : string
8384 {
84- $ this ->getTimestamp ()-> setTimezone ( new DateTimeZone ( ' GMT ' ) );
85+ $ timestamp = $ this ->getTimestamp ();
8586
86- return $ this ->getTimestamp ()->format (DateTime::RFC822 );
87+ /** @psalm-suppress RedundantCondition */
88+ if ($ timestamp instanceof DateTime ||
89+ $ timestamp instanceof DateTimeImmutable) {
90+ $ timestamp ->setTimezone (new DateTimeZone ('GMT ' ));
91+ }
92+
93+ return $ timestamp ->format (DateTime::RFC822 );
8794 }
8895}
Original file line number Diff line number Diff line change 1515 * Import classes
1616 */
1717use DateTime ;
18+ use DateTimeImmutable ;
1819use DateTimeInterface ;
1920use DateTimeZone ;
2021
@@ -81,8 +82,14 @@ public function getFieldName() : string
8182 */
8283 public function getFieldValue () : string
8384 {
84- $ this ->getTimestamp ()-> setTimezone ( new DateTimeZone ( ' GMT ' ) );
85+ $ timestamp = $ this ->getTimestamp ();
8586
86- return $ this ->getTimestamp ()->format (DateTime::RFC822 );
87+ /** @psalm-suppress RedundantCondition */
88+ if ($ timestamp instanceof DateTime ||
89+ $ timestamp instanceof DateTimeImmutable) {
90+ $ timestamp ->setTimezone (new DateTimeZone ('GMT ' ));
91+ }
92+
93+ return $ timestamp ->format (DateTime::RFC822 );
8794 }
8895}
Original file line number Diff line number Diff line change 1515 * Import classes
1616 */
1717use DateTime ;
18+ use DateTimeImmutable ;
1819use DateTimeInterface ;
1920use DateTimeZone ;
2021
@@ -81,8 +82,14 @@ public function getFieldName() : string
8182 */
8283 public function getFieldValue () : string
8384 {
84- $ this ->getTimestamp ()-> setTimezone ( new DateTimeZone ( ' GMT ' ) );
85+ $ timestamp = $ this ->getTimestamp ();
8586
86- return $ this ->getTimestamp ()->format (DateTime::RFC822 );
87+ /** @psalm-suppress RedundantCondition */
88+ if ($ timestamp instanceof DateTime ||
89+ $ timestamp instanceof DateTimeImmutable) {
90+ $ timestamp ->setTimezone (new DateTimeZone ('GMT ' ));
91+ }
92+
93+ return $ timestamp ->format (DateTime::RFC822 );
8794 }
8895}
You can’t perform that action at this time.
0 commit comments