Skip to content

Commit 832faf3

Browse files
authored
Use int as the PHP representation of long fields in generated code (#1471)
* Use int as the PHP representation of long fields in generated code * Add changelog entries for signature changes affecting strict types * Remove generator hacks needed for endpoint shapes to force the type Now that long fields are always defined as integer, we don't need such hacks anymore
1 parent f176df5 commit 832faf3

File tree

4 files changed

+34
-30
lines changed

4 files changed

+34
-30
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### BC-BREAK
6+
7+
- The return type for the methods `getFailed`, `getInProgress`, `getPending`, `getReady`, `getSkipped` and `getSucceeded` of `\AsyncAws\CodeDeploy\ValueObject\DeploymentOverview` uses `int` instead of `string` to reflect the AWS type.
8+
59
## 1.4.0
610

711
### Added

src/Result/GetDeploymentOutput.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ private function populateResultDeploymentInfo(array $json): DeploymentInfo
189189
private function populateResultDeploymentOverview(array $json): DeploymentOverview
190190
{
191191
return new DeploymentOverview([
192-
'Pending' => isset($json['Pending']) ? (string) $json['Pending'] : null,
193-
'InProgress' => isset($json['InProgress']) ? (string) $json['InProgress'] : null,
194-
'Succeeded' => isset($json['Succeeded']) ? (string) $json['Succeeded'] : null,
195-
'Failed' => isset($json['Failed']) ? (string) $json['Failed'] : null,
196-
'Skipped' => isset($json['Skipped']) ? (string) $json['Skipped'] : null,
197-
'Ready' => isset($json['Ready']) ? (string) $json['Ready'] : null,
192+
'Pending' => isset($json['Pending']) ? (int) $json['Pending'] : null,
193+
'InProgress' => isset($json['InProgress']) ? (int) $json['InProgress'] : null,
194+
'Succeeded' => isset($json['Succeeded']) ? (int) $json['Succeeded'] : null,
195+
'Failed' => isset($json['Failed']) ? (int) $json['Failed'] : null,
196+
'Skipped' => isset($json['Skipped']) ? (int) $json['Skipped'] : null,
197+
'Ready' => isset($json['Ready']) ? (int) $json['Ready'] : null,
198198
]);
199199
}
200200

src/ValueObject/DeploymentOverview.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ final class DeploymentOverview
3939

4040
/**
4141
* @param array{
42-
* Pending?: null|string,
43-
* InProgress?: null|string,
44-
* Succeeded?: null|string,
45-
* Failed?: null|string,
46-
* Skipped?: null|string,
47-
* Ready?: null|string,
42+
* Pending?: null|int,
43+
* InProgress?: null|int,
44+
* Succeeded?: null|int,
45+
* Failed?: null|int,
46+
* Skipped?: null|int,
47+
* Ready?: null|int,
4848
* } $input
4949
*/
5050
public function __construct(array $input)
@@ -59,45 +59,45 @@ public function __construct(array $input)
5959

6060
/**
6161
* @param array{
62-
* Pending?: null|string,
63-
* InProgress?: null|string,
64-
* Succeeded?: null|string,
65-
* Failed?: null|string,
66-
* Skipped?: null|string,
67-
* Ready?: null|string,
62+
* Pending?: null|int,
63+
* InProgress?: null|int,
64+
* Succeeded?: null|int,
65+
* Failed?: null|int,
66+
* Skipped?: null|int,
67+
* Ready?: null|int,
6868
* }|DeploymentOverview $input
6969
*/
7070
public static function create($input): self
7171
{
7272
return $input instanceof self ? $input : new self($input);
7373
}
7474

75-
public function getFailed(): ?string
75+
public function getFailed(): ?int
7676
{
7777
return $this->failed;
7878
}
7979

80-
public function getInProgress(): ?string
80+
public function getInProgress(): ?int
8181
{
8282
return $this->inProgress;
8383
}
8484

85-
public function getPending(): ?string
85+
public function getPending(): ?int
8686
{
8787
return $this->pending;
8888
}
8989

90-
public function getReady(): ?string
90+
public function getReady(): ?int
9191
{
9292
return $this->ready;
9393
}
9494

95-
public function getSkipped(): ?string
95+
public function getSkipped(): ?int
9696
{
9797
return $this->skipped;
9898
}
9999

100-
public function getSucceeded(): ?string
100+
public function getSucceeded(): ?int
101101
{
102102
return $this->succeeded;
103103
}

tests/Unit/Result/GetDeploymentOutputTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ public function testGetDeploymentOutput(): void
216216
self::assertSame(InstanceAction::TERMINATE, $info->getBlueGreenDeploymentConfiguration()->getTerminateBlueInstancesOnDeploymentSuccess()->getAction());
217217
self::assertSame(2, $info->getBlueGreenDeploymentConfiguration()->getTerminateBlueInstancesOnDeploymentSuccess()->getTerminationWaitTimeInMinutes());
218218

219-
self::assertSame('1', $info->getDeploymentOverview()->getFailed());
220-
self::assertSame('2', $info->getDeploymentOverview()->getInProgress());
221-
self::assertSame('3', $info->getDeploymentOverview()->getPending());
222-
self::assertSame('4', $info->getDeploymentOverview()->getReady());
223-
self::assertSame('5', $info->getDeploymentOverview()->getSkipped());
224-
self::assertSame('6', $info->getDeploymentOverview()->getSucceeded());
219+
self::assertSame(1, $info->getDeploymentOverview()->getFailed());
220+
self::assertSame(2, $info->getDeploymentOverview()->getInProgress());
221+
self::assertSame(3, $info->getDeploymentOverview()->getPending());
222+
self::assertSame(4, $info->getDeploymentOverview()->getReady());
223+
self::assertSame(5, $info->getDeploymentOverview()->getSkipped());
224+
self::assertSame(6, $info->getDeploymentOverview()->getSucceeded());
225225

226226
self::assertSame(DeploymentOption::WITH_TRAFFIC_CONTROL, $info->getDeploymentStyle()->getDeploymentOption());
227227
self::assertSame(DeploymentType::IN_PLACE, $info->getDeploymentStyle()->getDeploymentType());

0 commit comments

Comments
 (0)