You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before deleting, alternatives should be checked. And if these exist, they must be inserted into the documentation.
I should have included it in my bug report, I found it by reading the code, we can use $message->getHeaders()->has('header-name') to check if an header exists.
I also noted this part in the same doc page which does not work as intended:
foreach ($message->getHeaders() as $name => $value) {
if (is_string($value)) {
echo "$name: $value\n";
continue;
}
foreach ($value as $entry) {
echo "$name: $entry\n";
}
}
$name does not get populated with the header name, but with an index of the header. I used this instead to loop using foreach and retrieve the the header name and value :
foreach ($message->getHeaders() as $header) {
$name = $header->getFieldName();
$value = $header->getFieldValue();
if (is_string($value)) {
echo "$name: $value\n";
continue;
}
foreach ($value as $entry) {
echo "$name: $entry\n";
}
}
Bug Report
Summary
The method
headerExists
on a Message object does not exist, it should be removed from the documentation.See documentation here: https://docs.laminas.dev/laminas-mail/read/
Current behavior
The method
headerExists
on a Message object does not exist, it should be removed from the documentation.How to reproduce
N/A
Expected behavior
N/A
The text was updated successfully, but these errors were encountered: