Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
131 changes: 131 additions & 0 deletions src/Struct/LeadPage/LeadpageArticle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?php

declare(strict_types=1);

namespace Scn\EvalancheSoapStruct\Struct\LeadPage;

/**
* Reference to an article in a leadpage
*
* @package Scn\EvalancheSoapStruct\Struct\Leadpage
*/
class LeadpageArticle implements LeadpageArticleInterface
{
/**
* @var int
*/
private $id;

/**
* @var int
*/
private $articleId;

/**
* @var int
*/
private $targetGroupId;

/**
* @var int
*/
private $landingpagePresetId;

/**
* @var int
*/
private $mobilePresetId;

/**
* @var int
*/
private $sortPos;

/**
* @var int
*/
private $slot;

/**
* @param int $id
* @param int $articleId
* @param int $targetGroupId
* @param int $landingpagePresetId
* @param int $mobilePresetId
* @param int $sortPos
* @param int $slot
*/
public function __construct(
int $id = null,
int $articleId = null,
int $targetGroupId = null,
int $landingpagePresetId = null,
int $mobilePresetId = null,
int $sortPos = null,
int $slot = null
) {
$this->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;
}
}
48 changes: 48 additions & 0 deletions src/Struct/LeadPage/LeadpageArticleInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Scn\EvalancheSoapStruct\Struct\LeadPage;

use Scn\EvalancheSoapStruct\Struct\StructInterface;

/**
* Interface MailingArticleInterface
*
* @package Scn\EvalancheSoapStruct\Struct\Leadpage
*/
interface LeadpageArticleInterface extends StructInterface
{
/**
* @return int
*/
public function getId(): int;

/**
* @return int
*/
public function getArticleId(): int;

/**
* @return int
*/
public function getTargetGroupId(): int;

/**
* @return int
*/
public function getLandingpagePresetId(): int;

/**
* @return int
*/
public function getMobilePresetId(): int;

/**
* @return int
*/
public function getSortPos(): int;

/**
* @return int
*/
public function getSlot(): int;
}
63 changes: 63 additions & 0 deletions tests/Struct/LeadPage/LeadpageArticleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

declare(strict_types=1);

namespace Scn\EvalancheSoapStruct\Struct\LeadPage;

use PHPUnit\Framework\TestCase;

class LeadpageArticleTest extends TestCase
{
/**
* @var LeadpageArticle
*/
private $subject;

public function setUp(): void
{
$this->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());
}
}
Loading