Skip to content

Commit 478e190

Browse files
committed
Add last modified to resource information struct
1 parent 89ea924 commit 478e190

12 files changed

+28
-205
lines changed

phpstan-baseline.neon

-30
Original file line numberDiff line numberDiff line change
@@ -510,36 +510,6 @@ parameters:
510510
count: 1
511511
path: src/Struct/Generic/MassUpdateResult.php
512512

513-
-
514-
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Generic\\\\ResourceInformation\\:\\:\\$folderId \\(int\\) does not accept int\\|null\\.$#"
515-
count: 1
516-
path: src/Struct/Generic/ResourceInformation.php
517-
518-
-
519-
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Generic\\\\ResourceInformation\\:\\:\\$id \\(int\\) does not accept int\\|null\\.$#"
520-
count: 1
521-
path: src/Struct/Generic/ResourceInformation.php
522-
523-
-
524-
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Generic\\\\ResourceInformation\\:\\:\\$mandatorId \\(int\\) does not accept int\\|null\\.$#"
525-
count: 1
526-
path: src/Struct/Generic/ResourceInformation.php
527-
528-
-
529-
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Generic\\\\ResourceInformation\\:\\:\\$name \\(string\\) does not accept string\\|null\\.$#"
530-
count: 1
531-
path: src/Struct/Generic/ResourceInformation.php
532-
533-
-
534-
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Generic\\\\ResourceInformation\\:\\:\\$typeId \\(int\\) does not accept int\\|null\\.$#"
535-
count: 1
536-
path: src/Struct/Generic/ResourceInformation.php
537-
538-
-
539-
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Generic\\\\ResourceInformation\\:\\:\\$url \\(string\\) does not accept string\\|null\\.$#"
540-
count: 1
541-
path: src/Struct/Generic/ResourceInformation.php
542-
543513
-
544514
message: "#^Property Scn\\\\EvalancheSoapStruct\\\\Struct\\\\Generic\\\\ResourceTypeInformation\\:\\:\\$description \\(string\\) does not accept string\\|null\\.$#"
545515
count: 1

src/Struct/Generic/ResourceInformation.php

+12-70
Original file line numberDiff line numberDiff line change
@@ -6,110 +6,52 @@
66

77
/**
88
* Evalanche object like mailing, image, template, etc.
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
119
*/
1210
class ResourceInformation implements ResourceInformationInterface
1311
{
14-
/**
15-
* @var int
16-
*/
17-
private $id;
18-
19-
/**
20-
* @var string
21-
*/
22-
private $name;
23-
24-
/**
25-
* @var string
26-
*/
27-
private $url;
28-
29-
/**
30-
* @var int
31-
*/
32-
private $typeId;
33-
34-
/**
35-
* @var int
36-
*/
37-
private $folderId;
38-
39-
/**
40-
* @var int
41-
*/
42-
private $mandatorId;
43-
44-
/**
45-
* @param int $id
46-
* @param string $name
47-
* @param string $url
48-
* @param int $typeId
49-
* @param int $folderId
50-
* @param int $mandatorId
51-
*/
5212
public function __construct(
53-
int $id = null,
54-
string $name = null,
55-
string $url = null,
56-
int $typeId = null,
57-
int $folderId = null,
58-
int $mandatorId = null
13+
private readonly int $id,
14+
private readonly string $name,
15+
private readonly string $url,
16+
private readonly int $typeId,
17+
private readonly int $folderId,
18+
private readonly int $mandatorId,
19+
private readonly int $lastModified,
5920
) {
60-
$this->id = $id;
61-
$this->name = $name;
62-
$this->url = $url;
63-
$this->typeId = $typeId;
64-
$this->folderId = $folderId;
65-
$this->mandatorId = $mandatorId;
6621
}
6722

68-
/**
69-
* @return int
70-
*/
7123
public function getId(): int
7224
{
7325
return $this->id;
7426
}
7527

76-
/**
77-
* @return string
78-
*/
7928
public function getName(): string
8029
{
8130
return $this->name;
8231
}
8332

84-
/**
85-
* @return string
86-
*/
8733
public function getUrl(): string
8834
{
8935
return $this->url;
9036
}
9137

92-
/**
93-
* @return int
94-
*/
9538
public function getTypeId(): int
9639
{
9740
return $this->typeId;
9841
}
9942

100-
/**
101-
* @return int
102-
*/
10343
public function getFolderId(): int
10444
{
10545
return $this->folderId;
10646
}
10747

108-
/**
109-
* @return int
110-
*/
11148
public function getMandatorId(): int
11249
{
11350
return $this->mandatorId;
11451
}
52+
53+
public function getLastModified(): int
54+
{
55+
return $this->lastModified;
56+
}
11557
}

src/Struct/Generic/ResourceInformationInterface.php

-23
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,17 @@
44

55
use Scn\EvalancheSoapStruct\Struct\StructInterface;
66

7-
/**
8-
* Class ResourceInformationInterface
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
interface ResourceInformationInterface extends StructInterface
138
{
14-
/**
15-
* @return int
16-
*/
179
public function getId(): int;
1810

19-
/**
20-
* @return string
21-
*/
2211
public function getName(): string;
2312

24-
/**
25-
* @return string
26-
*/
2713
public function getUrl(): string;
2814

29-
/**
30-
* @return int
31-
*/
3215
public function getTypeId(): int;
3316

34-
/**
35-
* @return int
36-
*/
3717
public function getFolderId(): int;
3818

39-
/**
40-
* @return int
41-
*/
4219
public function getMandatorId(): int;
4320
}

tests/Struct/Generic/FolderInformationTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class FolderInformationTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class FolderInformationTest extends StructTestCase
138
{
14-
/**
15-
* @var FolderInformation
16-
*/
17-
private $subject;
9+
private FolderInformation $subject;
1810

1911
public function setUp(): void
2012
{

tests/Struct/Generic/HashMapItemTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class HashMapItemTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class HashMapItemTest extends StructTestCase
138
{
14-
/**
15-
* @var HashMapItem
16-
*/
17-
private $subject;
9+
private HashMapItem $subject;
1810

1911
public function setUp(): void
2012
{

tests/Struct/Generic/HashMapTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class HashMapTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class HashMapTest extends StructTestCase
138
{
14-
/**
15-
* @var HashMap
16-
*/
17-
private $subject;
9+
private HashMap $subject;
1810

1911
public function setUp(): void
2012
{

tests/Struct/Generic/JobHandleTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class JobHandleTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class JobHandleTest extends StructTestCase
138
{
14-
/**
15-
* @var JobHandle
16-
*/
17-
private $subject;
9+
private JobHandle $subject;
1810

1911
public function setUp(): void
2012
{

tests/Struct/Generic/JobResultTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class JobResultTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class JobResultTest extends StructTestCase
138
{
14-
/**
15-
* @var JobResult
16-
*/
17-
private $subject;
9+
private JobResult $subject;
1810

1911
public function setUp(): void
2012
{

tests/Struct/Generic/MassUpdateResultTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class MassUpdateResultTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class MassUpdateResultTest extends StructTestCase
138
{
14-
/**
15-
* @var MassUpdateResult
16-
*/
17-
private $subject;
9+
private MassUpdateResult $subject;
1810

1911
public function setUp(): void
2012
{

tests/Struct/Generic/ResourceInformationTest.php

+8-10
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class ResourceInformationTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class ResourceInformationTest extends StructTestCase
138
{
14-
/**
15-
* @var ResourceInformation
16-
*/
17-
private $subject;
9+
private ResourceInformation $subject;
1810

1911
public function setUp(): void
2012
{
@@ -24,7 +16,8 @@ public function setUp(): void
2416
'some url',
2517
5,
2618
9,
27-
989
19+
989,
20+
44455
2821
);
2922
}
3023

@@ -57,4 +50,9 @@ public function testGetMandatorIdCanReturnInt(): void
5750
{
5851
self::assertSame(989, $this->subject->getMandatorId());
5952
}
53+
54+
public function testGetLastModifiedByIdCanReturnInt(): void
55+
{
56+
self::assertSame(44455, $this->subject->getLastModified());
57+
}
6058
}

tests/Struct/Generic/ResourceTypeInformationTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class ResourceTypeInformationTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class ResourceTypeInformationTest extends StructTestCase
138
{
14-
/**
15-
* @var ResourceTypeInformation
16-
*/
17-
private $subject;
9+
private ResourceTypeInformation $subject;
1810

1911
public function setUp(): void
2012
{

tests/Struct/Generic/ServiceStatusTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44

55
use Scn\EvalancheSoapStruct\StructTestCase;
66

7-
/**
8-
* Class ServiceStatusTest
9-
*
10-
* @package Scn\EvalancheSoapStruct\Struct\Generic
11-
*/
127
class ServiceStatusTest extends StructTestCase
138
{
14-
/**
15-
* @var ServiceStatus
16-
*/
17-
private $subject;
9+
private ServiceStatus $subject;
1810

1911
public function setUp(): void
2012
{

0 commit comments

Comments
 (0)