@@ -76,66 +76,43 @@ public function getMaxLineLength(): int
76
76
77
77
/**
78
78
* @param array<Address|string> $addresses
79
- *
80
- * @return $this
81
79
*/
82
- public function addMailboxListHeader (string $ name , array $ addresses ): self
80
+ public function addMailboxListHeader (string $ name , array $ addresses ): static
83
81
{
84
82
return $ this ->add (new MailboxListHeader ($ name , Address::createArray ($ addresses )));
85
83
}
86
84
87
- /**
88
- * @return $this
89
- */
90
- public function addMailboxHeader (string $ name , Address |string $ address ): self
85
+ public function addMailboxHeader (string $ name , Address |string $ address ): static
91
86
{
92
87
return $ this ->add (new MailboxHeader ($ name , Address::create ($ address )));
93
88
}
94
89
95
- /**
96
- * @return $this
97
- */
98
- public function addIdHeader (string $ name , string |array $ ids ): self
90
+ public function addIdHeader (string $ name , string |array $ ids ): static
99
91
{
100
92
return $ this ->add (new IdentificationHeader ($ name , $ ids ));
101
93
}
102
94
103
- /**
104
- * @return $this
105
- */
106
- public function addPathHeader (string $ name , Address |string $ path ): self
95
+ public function addPathHeader (string $ name , Address |string $ path ): static
107
96
{
108
97
return $ this ->add (new PathHeader ($ name , $ path instanceof Address ? $ path : new Address ($ path )));
109
98
}
110
99
111
- /**
112
- * @return $this
113
- */
114
- public function addDateHeader (string $ name , \DateTimeInterface $ dateTime ): self
100
+ public function addDateHeader (string $ name , \DateTimeInterface $ dateTime ): static
115
101
{
116
102
return $ this ->add (new DateHeader ($ name , $ dateTime ));
117
103
}
118
104
119
- /**
120
- * @return $this
121
- */
122
- public function addTextHeader (string $ name , string $ value ): self
105
+ public function addTextHeader (string $ name , string $ value ): static
123
106
{
124
107
return $ this ->add (new UnstructuredHeader ($ name , $ value ));
125
108
}
126
109
127
- /**
128
- * @return $this
129
- */
130
- public function addParameterizedHeader (string $ name , string $ value , array $ params = []): self
110
+ public function addParameterizedHeader (string $ name , string $ value , array $ params = []): static
131
111
{
132
112
return $ this ->add (new ParameterizedHeader ($ name , $ value , $ params ));
133
113
}
134
114
135
- /**
136
- * @return $this
137
- */
138
- public function addHeader (string $ name , mixed $ argument , array $ more = []): self
115
+ public function addHeader (string $ name , mixed $ argument , array $ more = []): static
139
116
{
140
117
$ parts = explode ('\\' , self ::HEADER_CLASS_MAP [strtolower ($ name )] ?? UnstructuredHeader::class);
141
118
$ method = 'add ' .ucfirst (array_pop ($ parts ));
@@ -153,10 +130,7 @@ public function has(string $name): bool
153
130
return isset ($ this ->headers [strtolower ($ name )]);
154
131
}
155
132
156
- /**
157
- * @return $this
158
- */
159
- public function add (HeaderInterface $ header ): self
133
+ public function add (HeaderInterface $ header ): static
160
134
{
161
135
self ::checkHeaderClass ($ header );
162
136
0 commit comments