Skip to content

Commit 54eb265

Browse files
committed
Convert all non address header values to Attribute instances
1 parent 5f33f18 commit 54eb265

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/Header.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function get($name): Attribute {
107107
return $this->attributes[$name];
108108
}
109109

110-
return null;
110+
return new Attribute($name);
111111
}
112112

113113
/**
@@ -120,21 +120,7 @@ public function get($name): Attribute {
120120
*/
121121
public function set(string $name, mixed $value, bool $strict = false): Attribute|array {
122122
if (isset($this->attributes[$name]) && $strict === false) {
123-
if ($this->attributize) {
124-
$this->attributes[$name]->add($value, true);
125-
} else {
126-
if (isset($this->attributes[$name])) {
127-
if (!is_array($this->attributes[$name])) {
128-
$this->attributes[$name] = [$this->attributes[$name], $value];
129-
} else {
130-
$this->attributes[$name][] = $value;
131-
}
132-
} else {
133-
$this->attributes[$name] = $value;
134-
}
135-
}
136-
} elseif (!$this->attributize) {
137-
$this->attributes[$name] = $value;
123+
$this->attributes[$name]->add($value, true);
138124
} else {
139125
$this->attributes[$name] = new Attribute($name, $value);
140126
}

0 commit comments

Comments
 (0)