This commit is contained in:
Artem Bondarenko 2020-10-12 20:44:37 +03:00 committed by David Garcia
parent ab8324a178
commit 20385fe70c
5 changed files with 10 additions and 10 deletions

View File

@ -325,8 +325,8 @@ class Domain extends HttpApi
*
* @param string $domain name of the domain
*
* @param string $active
* @return UpdateClickTrackingResponse|array|ResponseInterface
*
* @throws \Exception
*/
public function updateClickTracking(string $domain, string $active)
@ -348,7 +348,7 @@ class Domain extends HttpApi
* Updates a domain open tracking settings.
*
* @param string $domain name of the domain
* @param bool $active
* @param bool $active
*
* @return UpdateOpenTrackingResponse|array|ResponseInterface
*/
@ -370,10 +370,9 @@ class Domain extends HttpApi
/**
* Updates a domain unsubscribe tracking settings.
*
* @param string $domain name of the domain
* @param string $active
* @param string $htmlFooter
* @param string $domain name of the domain
* @param string|null $textFooter
*
* @return UpdateUnsubscribeTrackingResponse|array|ResponseInterface
*/
public function updateUnsubscribeTracking(string $domain, string $active, string $htmlFooter, string $textFooter)
@ -385,7 +384,7 @@ class Domain extends HttpApi
Assert::nullOrString($textFooter);
$params = [
'active' => (in_array($active, ['yes', 'true'])) ? 'true' : 'false',
'active' => (in_array($active, ['yes', 'true'], true)) ? 'true' : 'false',
'html_footer' => $htmlFooter,
'text_footer' => $textFooter,
];

View File

@ -47,11 +47,11 @@ final class ClickTracking
public function isActive(): bool
{
return $this->getActive() === 'yes';
return 'yes' === $this->getActive();
}
public function isHtmlOnly(): bool
{
return $this->getActive() === 'htmlonly';
return 'htmlonly' === $this->getActive();
}
}

View File

@ -50,6 +50,6 @@ final class OpenTracking
public function isActive(): bool
{
return $this->getActive() === 'yes';
return 'yes' === $this->getActive();
}
}

View File

@ -38,7 +38,7 @@ final class UnsubscribeTracking
public function isActive(): bool
{
return $this->active === 'true';
return 'yes' === $this->getActive();
}
public function getActive(): string

View File

@ -44,6 +44,7 @@ JSON;
$this->assertInstanceOf(ClickTracking::class, $model->getClick());
$this->assertEquals('htmlonly', $model->getClick()->getActive());
$this->assertFalse($model->getClick()->isActive());
$this->assertTrue($model->getClick()->isHtmlOnly());
$this->assertNotEmpty($model->getOpen());
$this->assertInstanceOf(OpenTracking::class, $model->getOpen());