From 963dc3152b166f6a5c5e6bbab1b6933786ba4874 Mon Sep 17 00:00:00 2001 From: Daniel Jakob Date: Tue, 11 Nov 2025 08:06:59 +0100 Subject: [PATCH] Add new `LeadpageArticle` struct Also update dependencies --- phpstan-baseline.neon | 35 +++++ src/Struct/LeadPage/LeadpageArticle.php | 131 ++++++++++++++++++ .../LeadPage/LeadpageArticleInterface.php | 48 +++++++ tests/Struct/LeadPage/LeadpageArticleTest.php | 63 +++++++++ 4 files changed, 277 insertions(+) create mode 100644 src/Struct/LeadPage/LeadpageArticle.php create mode 100644 src/Struct/LeadPage/LeadpageArticleInterface.php create mode 100644 tests/Struct/LeadPage/LeadpageArticleTest.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 3a9ebef..4c39dd0 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -530,6 +530,41 @@ parameters: count: 1 path: src/Struct/Generic/ServiceStatus.php + - + message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$articleId \\(int\\) does not accept int\\|null\\.$#" + count: 1 + path: src/Struct/LeadPage/LeadpageArticle.php + + - + message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$id \\(int\\) does not accept int\\|null\\.$#" + count: 1 + path: src/Struct/LeadPage/LeadpageArticle.php + + - + message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$landingpagePresetId \\(int\\) does not accept int\\|null\\.$#" + count: 1 + path: src/Struct/LeadPage/LeadpageArticle.php + + - + message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$mobilePresetId \\(int\\) does not accept int\\|null\\.$#" + count: 1 + path: src/Struct/LeadPage/LeadpageArticle.php + + - + message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$slot \\(int\\) does not accept int\\|null\\.$#" + count: 1 + path: src/Struct/LeadPage/LeadpageArticle.php + + - + message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$sortPos \\(int\\) does not accept int\\|null\\.$#" + count: 1 + path: src/Struct/LeadPage/LeadpageArticle.php + + - + message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$targetGroupId \\(int\\) does not accept int\\|null\\.$#" + count: 1 + path: src/Struct/LeadPage/LeadpageArticle.php + - message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Mailing\\\\MailingArticle\\:\\:\\$articleId \\(int\\) does not accept int\\|null\\.$#" count: 1 diff --git a/src/Struct/LeadPage/LeadpageArticle.php b/src/Struct/LeadPage/LeadpageArticle.php new file mode 100644 index 0000000..67ea983 --- /dev/null +++ b/src/Struct/LeadPage/LeadpageArticle.php @@ -0,0 +1,131 @@ +id = $id; + $this->articleId = $articleId; + $this->targetGroupId = $targetGroupId; + $this->landingpagePresetId = $landingpagePresetId; + $this->mobilePresetId = $mobilePresetId; + $this->sortPos = $sortPos; + $this->slot = $slot; + } + + /** + * @return int + */ + public function getId(): int + { + return $this->id; + } + + /** + * @return int + */ + public function getArticleId(): int + { + return $this->articleId; + } + + /** + * @return int + */ + public function getTargetGroupId(): int + { + return $this->targetGroupId; + } + + /** + * @return int + */ + public function getLandingpagePresetId(): int + { + return $this->landingpagePresetId; + } + + /** + * @return int + */ + public function getMobilePresetId(): int + { + return $this->mobilePresetId; + } + + /** + * @return int + */ + public function getSortPos(): int + { + return $this->sortPos; + } + + /** + * @return int + */ + public function getSlot(): int + { + return $this->slot; + } +} diff --git a/src/Struct/LeadPage/LeadpageArticleInterface.php b/src/Struct/LeadPage/LeadpageArticleInterface.php new file mode 100644 index 0000000..28d075f --- /dev/null +++ b/src/Struct/LeadPage/LeadpageArticleInterface.php @@ -0,0 +1,48 @@ +subject = new LeadpageArticle( + 1, + 2, + 3, + 7, + 8, + 9, + 10 + ); + } + + public function testGetIdCanReturnInt(): void + { + self::assertSame(1, $this->subject->getId()); + } + + public function testGetArticleIdCanReturnInt(): void + { + self::assertSame(2, $this->subject->getArticleId()); + } + + public function testGetTargetGroupIdCanReturnInt(): void + { + self::assertSame(3, $this->subject->getTargetGroupId()); + } + + public function testLandingPagePresetIdCanReturnInt(): void + { + self::assertSame(7, $this->subject->getLandingpagePresetId()); + } + + public function testMobilePresetIdCanReturnInt(): void + { + self::assertSame(8, $this->subject->getMobilePresetId()); + } + + public function testGetSortPosCanReturnInt(): void + { + self::assertSame(9, $this->subject->getSortPos()); + } + + public function testGetSlotCanReturnInt(): void + { + self::assertSame(10, $this->subject->getSlot()); + } +}