mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-25 22:36:06 +03:00
comments fix
This commit is contained in:
parent
c48f246942
commit
87c59dc386
@ -323,7 +323,8 @@ class Domain extends HttpApi
|
||||
/**
|
||||
* Updates a domain click tracking settings.
|
||||
*
|
||||
* @param string $domain name of the domain
|
||||
* @param string $domain The name of the domain
|
||||
* @param string $active The status for this tracking (one of: yes, no)
|
||||
*
|
||||
* @return UpdateClickTrackingResponse|array|ResponseInterface
|
||||
*
|
||||
@ -347,7 +348,8 @@ class Domain extends HttpApi
|
||||
/**
|
||||
* Updates a domain open tracking settings.
|
||||
*
|
||||
* @param string $domain name of the domain
|
||||
* @param string $domain The name of the domain
|
||||
* @param string $active The status for this tracking (one of: yes, no)
|
||||
*
|
||||
* @return UpdateOpenTrackingResponse|array|ResponseInterface
|
||||
*/
|
||||
@ -369,7 +371,10 @@ class Domain extends HttpApi
|
||||
/**
|
||||
* Updates a domain unsubscribe tracking settings.
|
||||
*
|
||||
* @param string $domain name of the domain
|
||||
* @param string $domain The name of the domain
|
||||
* @param string $active The status for this tracking (one of: yes, no)
|
||||
* @param string $htmlFooter The footer for HTML emails
|
||||
* @param string $textFooter The footer for plain text emails
|
||||
*
|
||||
* @return UpdateUnsubscribeTrackingResponse|array|ResponseInterface
|
||||
*
|
||||
|
@ -22,16 +22,9 @@ final class ClickTracking
|
||||
|
||||
public static function create(array $data): self
|
||||
{
|
||||
$model = new self();
|
||||
$active = $data['active'] ?? null;
|
||||
|
||||
if (true === $active) {
|
||||
$model->active = 'yes';
|
||||
} elseif (false === $active) {
|
||||
$model->active = 'no';
|
||||
} else {
|
||||
$model->active = $active;
|
||||
}
|
||||
$model = new self();
|
||||
$model->active = 'htmlonly' === $active ? $active : ($active ? 'yes' : 'no');
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
@ -22,16 +22,9 @@ final class OpenTracking
|
||||
|
||||
public static function create(array $data): self
|
||||
{
|
||||
$model = new self();
|
||||
$active = $data['active'] ?? null;
|
||||
|
||||
if (true === $active) {
|
||||
$model->active = 'yes';
|
||||
} elseif (false === $active) {
|
||||
$model->active = 'no';
|
||||
} else {
|
||||
$model->active = $active;
|
||||
}
|
||||
$model = new self();
|
||||
$model->active = $active ? 'yes' : 'no';
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ final class UnsubscribeTracking
|
||||
public static function create(array $data): self
|
||||
{
|
||||
$model = new self();
|
||||
$model->active = ($data['active'] ?? null) ? 'true' : 'false';
|
||||
$model->active = ($data['active'] ?? null) ? 'yes' : 'no';
|
||||
$model->htmlFooter = $data['html_footer'] ?? '';
|
||||
$model->textFooter = $data['text_footer'] ?? '';
|
||||
|
||||
@ -38,7 +38,7 @@ final class UnsubscribeTracking
|
||||
|
||||
public function isActive(): bool
|
||||
{
|
||||
return 'true' === $this->getActive();
|
||||
return 'yes' === $this->getActive();
|
||||
}
|
||||
|
||||
public function getActive(): string
|
||||
|
@ -29,7 +29,7 @@ class TrackingResponseTest extends BaseModelTest
|
||||
"active": "htmlonly"
|
||||
},
|
||||
"open": {
|
||||
"active": "no"
|
||||
"active": false
|
||||
},
|
||||
"unsubscribe": {
|
||||
"active": false,
|
||||
@ -53,7 +53,7 @@ JSON;
|
||||
|
||||
$this->assertNotEmpty($model->getUnsubscribe());
|
||||
$this->assertInstanceOf(UnsubscribeTracking::class, $model->getUnsubscribe());
|
||||
$this->assertEquals('false', $model->getUnsubscribe()->getActive());
|
||||
$this->assertEquals('no', $model->getUnsubscribe()->getActive());
|
||||
$this->assertFalse($model->getUnsubscribe()->isActive());
|
||||
$this->assertEquals('<s>Test</s>', $model->getUnsubscribe()->getHtmlFooter());
|
||||
$this->assertEquals('Test', $model->getUnsubscribe()->getTextFooter());
|
||||
|
@ -23,7 +23,7 @@ class UpdateOpenTrackingResponseTest extends BaseModelTest
|
||||
<<<'JSON'
|
||||
{
|
||||
"open": {
|
||||
"active": "no"
|
||||
"active": false
|
||||
},
|
||||
"message": "Domain tracking settings have been updated"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user