Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit cc35f72

Browse files
committed
Do not use foreach variable after loop
Just return FALSE if the loop has not returned already.
1 parent cc533b0 commit cc35f72

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lib/Postmark/Inbound.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,20 @@ public function FromName()
6969

7070
public function Headers($name = 'X-Spam-Status')
7171
{
72-
foreach($this->Source->Headers as $header)
72+
foreach ($this->Source->Headers as $header)
7373
{
74-
if(isset($header->Name) AND $header->Name == $name)
74+
if (isset($header->Name) AND $header->Name == $name)
7575
{
76-
if($header->Name == 'Received-SPF')
76+
if ($header->Name == 'Received-SPF')
7777
{
7878
return self::_parseReceivedSpf($header->Value);
7979
}
8080

8181
return $header->Value;
8282
}
83-
else
84-
{
85-
unset($header);
86-
}
8783
}
8884

89-
return $header ? $header : FALSE;
85+
return FALSE;
9086
}
9187

9288
private static function _parseReceivedSpf($header)
@@ -137,4 +133,4 @@ public function HasAttachments()
137133
return count($this->Source->Attachments) > 0 ? TRUE : FALSE;
138134
}
139135

140-
}
136+
}

0 commit comments

Comments
 (0)