We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9e7b61 commit 5cdd202Copy full SHA for 5cdd202
lib/Headers/Date.php
@@ -7,7 +7,7 @@
7
use DateTimeZone;
8
9
/**
10
- * A date time object that renders into a string formatted for HTTP header fields.
+ * Representation of a 'Date' header field.
11
*
12
* @property-read bool $is_empty
13
* Whether the value of the {@see Date} is empty.
@@ -19,14 +19,12 @@
19
readonly class Date
20
{
21
public static function from(
22
- self|DateTimeInterface|int|string|null $source
+ DateTimeInterface|int|string|null $source
23
): self {
24
$timezone = null;
25
26
if ($source === null) {
27
return new self();
28
- } elseif ($source instanceof self) {
29
- return $source;
30
} elseif ($source instanceof DateTimeInterface) {
31
$timezone = $source->getTimezone();
32
$source = $source->format('Y-m-d\TH:i:s.u');
0 commit comments