reformat code

This commit is contained in:
Daniel Seifert 2025-01-02 23:52:24 +01:00
bovenliggende 880608ed64
commit 0110a3b7b9
Getekend door: DanielS
GPG sleutel-ID: 6A513E13AEE66170
3 gewijzigde bestanden met toevoegingen van 15 en 14 verwijderingen

Bestand weergeven

@ -313,7 +313,7 @@ class Subscriber extends ArrayCollection
} }
/** /**
* @return ?bool * @return null|bool
* @throws BaseException * @throws BaseException
*/ */
public function persist(): ?bool public function persist(): ?bool
@ -350,7 +350,7 @@ class Subscriber extends ArrayCollection
$addTags = array_diff($this->getTags()->toArray(), $currentTags->toArray()); $addTags = array_diff($this->getTags()->toArray(), $currentTags->toArray());
if (count($addTags)) { if (count($addTags)) {
$this->endpoint->tag( $this->getEmailAddress(), array_diff( $this->getTags()->toArray(), $currentTags->toArray() ) ); $this->endpoint->tag($this->getEmailAddress(), $addTags);
} }
} }

Bestand weergeven

@ -59,10 +59,10 @@ class Tag extends ArrayCollection
} }
/** /**
* @return bool * @return null|bool
* @throws BaseException * @throws BaseException
*/ */
public function persist(): bool public function persist(): ?bool
{ {
return $this->endpoint?->update( return $this->endpoint?->update(
$this->getId(), $this->getId(),

Bestand weergeven

@ -626,8 +626,7 @@ class SubscriberTest extends TestCase
?array $newTagList, ?array $newTagList,
InvokedCount $removeTagInvocation, InvokedCount $removeTagInvocation,
InvokedCount $setTagInvocation InvokedCount $setTagInvocation
) ) {
{
$entityMock = $this->getMockBuilder(Subscriber::class) $entityMock = $this->getMockBuilder(Subscriber::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
->onlyMethods(['getTags']) ->onlyMethods(['getTags'])
@ -646,7 +645,9 @@ class SubscriberTest extends TestCase
$endpointMock->expects($removeTagInvocation)->method('untag')->willReturn(true); $endpointMock->expects($removeTagInvocation)->method('untag')->willReturn(true);
$sut = new Subscriber(['id' => 'foo', 'email' => 'mymail@mydomain.tld'], $endpointSet ? $endpointMock : null); $sut = new Subscriber(['id' => 'foo', 'email' => 'mymail@mydomain.tld'], $endpointSet ? $endpointMock : null);
if ($newTagList) $sut->set('tags', $newTagList); if ($newTagList) {
$sut->set('tags', $newTagList);
}
$this->callMethod( $this->callMethod(
$sut, $sut,