-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19d4c4f
commit 0b6d918
Showing
6 changed files
with
108 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
Check warning on line 1 in src/Model/Templates/DeleteResponse.php GitHub Actions / PHP-CS-Fixer
Check warning on line 1 in src/Model/Templates/DeleteResponse.php GitHub Actions / PHP-CS-Fixer
Check warning on line 1 in src/Model/Templates/DeleteResponse.php GitHub Actions / PHP-CS-Fixer
|
||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Copyright (C) 2013 Mailgun | ||
* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
*/ | ||
|
||
namespace Mailgun\Model\Templates; | ||
|
||
use Mailgun\Model\ApiResponse; | ||
|
||
|
||
final class DeleteResponse implements ApiResponse | ||
{ | ||
/** | ||
* @var string $message | ||
*/ | ||
private $message; | ||
|
||
/** | ||
* @var Template $template | ||
*/ | ||
private $template; | ||
|
||
|
||
/** | ||
* @param array $data | ||
* @return static | ||
*/ | ||
public static function create(array $data): self | ||
{ | ||
$template = $data['template'] ?? $data; | ||
$model = new self(); | ||
$model->setMessage($data['message']); | ||
$model->setTemplate(Template::create($template)); | ||
|
||
return $model; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getMessage(): string | ||
{ | ||
return $this->message; | ||
} | ||
|
||
/** | ||
* @param string $message | ||
*/ | ||
public function setMessage(string $message): void | ||
{ | ||
$this->message = $message; | ||
} | ||
|
||
/** | ||
* @return Template | ||
*/ | ||
public function getTemplate(): Template | ||
{ | ||
return $this->template; | ||
} | ||
|
||
/** | ||
* @param Template $template | ||
*/ | ||
public function setTemplate(Template $template): void | ||
{ | ||
$this->template = $template; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,7 @@ | |
use Mailgun\Model\PagingProvider; | ||
use Psr\Http\Message\StreamInterface; | ||
|
||
/** | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
final class GetResponse implements ApiResponse, PagingProvider | ||
final class IndexResponse implements ApiResponse, PagingProvider | ||
{ | ||
use PaginationResponse; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,6 @@ | |
|
||
use Mailgun\Model\ApiResponse; | ||
|
||
/** | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
final class ShowResponse extends Template implements ApiResponse | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters