Skip to content

Commit ae64b86

Browse files
committed
Add new LeadpageArticle struct
Also update dependencies
1 parent 1ae911c commit ae64b86

File tree

4 files changed

+277
-0
lines changed

4 files changed

+277
-0
lines changed

phpstan-baseline.neon

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,41 @@ parameters:
530530
count: 1
531531
path: src/Struct/Generic/ServiceStatus.php
532532

533+
-
534+
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$articleId \\(int\\) does not accept int\\|null\\.$#"
535+
count: 1
536+
path: src/Struct/LeadPage/LeadpageArticle.php
537+
538+
-
539+
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$id \\(int\\) does not accept int\\|null\\.$#"
540+
count: 1
541+
path: src/Struct/LeadPage/LeadpageArticle.php
542+
543+
-
544+
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$landingpagePresetId \\(int\\) does not accept int\\|null\\.$#"
545+
count: 1
546+
path: src/Struct/LeadPage/LeadpageArticle.php
547+
548+
-
549+
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$mobilePresetId \\(int\\) does not accept int\\|null\\.$#"
550+
count: 1
551+
path: src/Struct/LeadPage/LeadpageArticle.php
552+
553+
-
554+
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$slot \\(int\\) does not accept int\\|null\\.$#"
555+
count: 1
556+
path: src/Struct/LeadPage/LeadpageArticle.php
557+
558+
-
559+
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$sortPos \\(int\\) does not accept int\\|null\\.$#"
560+
count: 1
561+
path: src/Struct/LeadPage/LeadpageArticle.php
562+
563+
-
564+
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\LeadPage\\\\LeadpageArticle\\:\\:\\$targetGroupId \\(int\\) does not accept int\\|null\\.$#"
565+
count: 1
566+
path: src/Struct/LeadPage/LeadpageArticle.php
567+
533568
-
534569
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Mailing\\\\MailingArticle\\:\\:\\$articleId \\(int\\) does not accept int\\|null\\.$#"
535570
count: 1
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Scn\EvalancheSoapStruct\Struct\LeadPage;
6+
7+
/**
8+
* Reference to an article in a leadpage
9+
*
10+
* @package Scn\EvalancheSoapStruct\Struct\Leadpage
11+
*/
12+
class LeadpageArticle implements LeadpageArticleInterface
13+
{
14+
/**
15+
* @var int
16+
*/
17+
private $id;
18+
19+
/**
20+
* @var int
21+
*/
22+
private $articleId;
23+
24+
/**
25+
* @var int
26+
*/
27+
private $targetGroupId;
28+
29+
/**
30+
* @var int
31+
*/
32+
private $landingpagePresetId;
33+
34+
/**
35+
* @var int
36+
*/
37+
private $mobilePresetId;
38+
39+
/**
40+
* @var int
41+
*/
42+
private $sortPos;
43+
44+
/**
45+
* @var int
46+
*/
47+
private $slot;
48+
49+
/**
50+
* @param int $id
51+
* @param int $articleId
52+
* @param int $targetGroupId
53+
* @param int $landingpagePresetId
54+
* @param int $mobilePresetId
55+
* @param int $sortPos
56+
* @param int $slot
57+
*/
58+
public function __construct(
59+
int $id = null,
60+
int $articleId = null,
61+
int $targetGroupId = null,
62+
int $landingpagePresetId = null,
63+
int $mobilePresetId = null,
64+
int $sortPos = null,
65+
int $slot = null
66+
) {
67+
$this->id = $id;
68+
$this->articleId = $articleId;
69+
$this->targetGroupId = $targetGroupId;
70+
$this->landingpagePresetId = $landingpagePresetId;
71+
$this->mobilePresetId = $mobilePresetId;
72+
$this->sortPos = $sortPos;
73+
$this->slot = $slot;
74+
}
75+
76+
/**
77+
* @return int
78+
*/
79+
public function getId(): int
80+
{
81+
return $this->id;
82+
}
83+
84+
/**
85+
* @return int
86+
*/
87+
public function getArticleId(): int
88+
{
89+
return $this->articleId;
90+
}
91+
92+
/**
93+
* @return int
94+
*/
95+
public function getTargetGroupId(): int
96+
{
97+
return $this->targetGroupId;
98+
}
99+
100+
/**
101+
* @return int
102+
*/
103+
public function getLandingpagePresetId(): int
104+
{
105+
return $this->landingpagePresetId;
106+
}
107+
108+
/**
109+
* @return int
110+
*/
111+
public function getMobilePresetId(): int
112+
{
113+
return $this->mobilePresetId;
114+
}
115+
116+
/**
117+
* @return int
118+
*/
119+
public function getSortPos(): int
120+
{
121+
return $this->sortPos;
122+
}
123+
124+
/**
125+
* @return int
126+
*/
127+
public function getSlot(): int
128+
{
129+
return $this->slot;
130+
}
131+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace Scn\EvalancheSoapStruct\Struct\LeadPage;
4+
5+
use Scn\EvalancheSoapStruct\Struct\StructInterface;
6+
7+
/**
8+
* Interface MailingArticleInterface
9+
*
10+
* @package Scn\EvalancheSoapStruct\Struct\Leadpage
11+
*/
12+
interface LeadpageArticleInterface extends StructInterface
13+
{
14+
/**
15+
* @return int
16+
*/
17+
public function getId(): int;
18+
19+
/**
20+
* @return int
21+
*/
22+
public function getArticleId(): int;
23+
24+
/**
25+
* @return int
26+
*/
27+
public function getTargetGroupId(): int;
28+
29+
/**
30+
* @return int
31+
*/
32+
public function getLandingpagePresetId(): int;
33+
34+
/**
35+
* @return int
36+
*/
37+
public function getMobilePresetId(): int;
38+
39+
/**
40+
* @return int
41+
*/
42+
public function getSortPos(): int;
43+
44+
/**
45+
* @return int
46+
*/
47+
public function getSlot(): int;
48+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Scn\EvalancheSoapStruct\Struct\LeadPage;
6+
7+
use PHPUnit\Framework\TestCase;
8+
9+
class LeadpageArticleTest extends TestCase
10+
{
11+
/**
12+
* @var LeadpageArticle
13+
*/
14+
private $subject;
15+
16+
public function setUp(): void
17+
{
18+
$this->subject = new LeadpageArticle(
19+
1,
20+
2,
21+
3,
22+
7,
23+
8,
24+
9,
25+
10
26+
);
27+
}
28+
29+
public function testGetIdCanReturnInt(): void
30+
{
31+
self::assertSame(1, $this->subject->getId());
32+
}
33+
34+
public function testGetArticleIdCanReturnInt(): void
35+
{
36+
self::assertSame(2, $this->subject->getArticleId());
37+
}
38+
39+
public function testGetTargetGroupIdCanReturnInt(): void
40+
{
41+
self::assertSame(3, $this->subject->getTargetGroupId());
42+
}
43+
44+
public function testLandingPagePresetIdCanReturnInt(): void
45+
{
46+
self::assertSame(7, $this->subject->getLandingpagePresetId());
47+
}
48+
49+
public function testMobilePresetIdCanReturnInt(): void
50+
{
51+
self::assertSame(8, $this->subject->getMobilePresetId());
52+
}
53+
54+
public function testGetSortPosCanReturnInt(): void
55+
{
56+
self::assertSame(9, $this->subject->getSortPos());
57+
}
58+
59+
public function testGetSlotCanReturnInt(): void
60+
{
61+
self::assertSame(10, $this->subject->getSlot());
62+
}
63+
}

0 commit comments

Comments
 (0)