Skip to content

Commit

Permalink
Exception2 (#127)
Browse files Browse the repository at this point in the history
An attempt to fix some issues that are not handled gracefully.

It seems as though on occasion there is an issue within the exception
handling. This tries to solve that.

---------

Co-authored-by: Ash <[email protected]>
Co-authored-by: Eli Wood <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2024
1 parent 4192e94 commit ac5354a
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.cache

Large diffs are not rendered by default.

145 changes: 18 additions & 127 deletions src/Postmark/Models/PostmarkBounce.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,328 +45,219 @@ public function __construct(array $values)
$this->Content = !empty($values['Content']) ? $values['Content'] : '';
}

/**
* @return int
*/
public function getID(): int
{
return $this->ID;
}

/**
* @param int $ID
* @return PostmarkBounce
*/
public function setID(int $ID): PostmarkBounce
{
$this->ID = $ID;

return $this;
}

/**
* @return string
*/
public function getType(): string
{
return $this->Type;
}

/**
* @param string $Type
* @return PostmarkBounce
*/
public function setType(string $Type): PostmarkBounce
{
$this->Type = $Type;

return $this;
}

/**
* @return int
*/
public function getTypeCode(): int
{
return $this->TypeCode;
}

/**
* @param int $TypeCode
* @return PostmarkBounce
*/
public function setTypeCode(int $TypeCode): PostmarkBounce
{
$this->TypeCode = $TypeCode;

return $this;
}

/**
* @return string
*/
public function getName(): string
{
return $this->Name;
}

/**
* @param string $Name
* @return PostmarkBounce
*/
public function setName(string $Name): PostmarkBounce
{
$this->Name = $Name;

return $this;
}

/**
* @return string
*/
public function getTag(): string
{
return $this->Tag;
}

/**
* @param string $Tag
* @return PostmarkBounce
*/
public function setTag(string $Tag): PostmarkBounce
{
$this->Tag = $Tag;

return $this;
}

/**
* @return string
*/
public function getMessageID(): string
{
return $this->MessageID;
}

/**
* @param string $MessageID
* @return PostmarkBounce
*/
public function setMessageID(string $MessageID): PostmarkBounce
{
$this->MessageID = $MessageID;

return $this;
}

/**
* @return int
*/
public function getServerID(): int
{
return $this->ServerID;
}

/**
* @param int $ServerID
* @return PostmarkBounce
*/
public function setServerID(int $ServerID): PostmarkBounce
{
$this->ServerID = $ServerID;

return $this;
}

/**
* @return string
*/
public function getMessageStream(): string
{
return $this->MessageStream;
}

/**
* @param string $MessageStream
* @return PostmarkBounce
*/
public function setMessageStream(string $MessageStream): PostmarkBounce
{
$this->MessageStream = $MessageStream;

return $this;
}

/**
* @return string
*/
public function getDescription(): string
{
return $this->Description;
}

/**
* @param string $Description
* @return PostmarkBounce
*/
public function setDescription(string $Description): PostmarkBounce
{
$this->Description = $Description;

return $this;
}

/**
* @return string
*/
public function getDetails(): string
{
return $this->Details;
}

/**
* @param string $Details
* @return PostmarkBounce
*/
public function setDetails(string $Details): PostmarkBounce
{
$this->Details = $Details;

return $this;
}

/**
* @return string
*/
public function getEmail(): string
{
return $this->Email;
}

/**
* @param string $Email
* @return PostmarkBounce
*/
public function setEmail(string $Email): PostmarkBounce
{
$this->Email = $Email;

return $this;
}

/**
* @return string
*/
public function getFrom(): string
{
return $this->From;
}

/**
* @param string $From
* @return PostmarkBounce
*/
public function setFrom(string $From): PostmarkBounce
{
$this->From = $From;

return $this;
}

/**
* @return string
*/
public function getBouncedAt(): string
{
return $this->BouncedAt;
}

/**
* @param string $BouncedAt
* @return PostmarkBounce
*/
public function setBouncedAt(string $BouncedAt): PostmarkBounce
{
$this->BouncedAt = $BouncedAt;

return $this;
}

/**
* @return bool
*/
public function getDumpAvailable(): bool
{
return $this->DumpAvailable;
}

/**
* @param bool $DumpAvailable
* @return PostmarkBounce
*/
public function setDumpAvailable(bool $DumpAvailable): PostmarkBounce
{
$this->DumpAvailable = $DumpAvailable;

return $this;
}

/**
* @return bool
*/
public function getInactive(): bool
{
return $this->Inactive;
}

/**
* @param bool $Inactive
* @return PostmarkBounce
*/
public function setInactive(bool $Inactive): PostmarkBounce
{
$this->Inactive = $Inactive;

return $this;
}

/**
* @return bool
*/
public function getCanActivate(): bool
{
return $this->CanActivate;
}

/**
* @param bool $CanActivate
* @return PostmarkBounce
*/
public function setCanActivate(bool $CanActivate): PostmarkBounce
{
$this->CanActivate = $CanActivate;

return $this;
}

/**
* @return string
*/
public function getSubject(): string
{
return $this->Subject;
}

/**
* @param string $Subject
* @return PostmarkBounce
*/
public function setSubject(string $Subject): PostmarkBounce
{
$this->Subject = $Subject;

return $this;
}

/**
* @return string
*/
public function getContent(): string
{
return $this->Content;
}

/**
* @param string $Content
* @return PostmarkBounce
*/
public function setContent(string $Content): PostmarkBounce
{
$this->Content = $Content;

return $this;
}

}
2 changes: 1 addition & 1 deletion src/Postmark/Models/PostmarkMessageDump.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function setBody(string $Body): PostmarkMessageDump

return $this;
}
}
}
4 changes: 2 additions & 2 deletions src/Postmark/Models/PostmarkMessageEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct(array $values = [])
$this->Type = !empty($values['Type']) ? $values['Type'] : '';
$this->ReceivedAt = !empty($values['ReceivedAt']) ? $values['ReceivedAt'] : '';

$arrayType = !empty($values['Details']) ? (array)$values['Details'] : [];
$arrayType = !empty($values['Details']) ? (array) $values['Details'] : [];
$this->Details = !empty($values['Details']) ? new PostmarkMessageEventDetails(
$arrayType
) : new PostmarkMessageEventDetails();
Expand Down Expand Up @@ -68,4 +68,4 @@ public function setDetails(PostmarkMessageEventDetails $Details): PostmarkMessag

return $this;
}
}
}
Loading

0 comments on commit ac5354a

Please sign in to comment.