Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e53c79d

Browse files
authored
Uncapitalize objects's property (#925)
* Uncapitalize objects's property * Add changelog * Improve lowercase naming * Rename sseKms to sseKms * Normalize Methods and Classes
1 parent 289a308 commit e53c79d

5 files changed

Lines changed: 45 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Added
66

7+
- Changed case of object's properties to camelCase.
78
- Added documentation in class's headers.
89

910
## 1.0.1

src/Input/PutEventsRequest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class PutEventsRequest extends Input
1818
*
1919
* @var PutEventsRequestEntry[]|null
2020
*/
21-
private $Entries;
21+
private $entries;
2222

2323
/**
2424
* @param array{
@@ -28,7 +28,7 @@ final class PutEventsRequest extends Input
2828
*/
2929
public function __construct(array $input = [])
3030
{
31-
$this->Entries = isset($input['Entries']) ? array_map([PutEventsRequestEntry::class, 'create'], $input['Entries']) : null;
31+
$this->entries = isset($input['Entries']) ? array_map([PutEventsRequestEntry::class, 'create'], $input['Entries']) : null;
3232
parent::__construct($input);
3333
}
3434

@@ -42,7 +42,7 @@ public static function create($input): self
4242
*/
4343
public function getEntries(): array
4444
{
45-
return $this->Entries ?? [];
45+
return $this->entries ?? [];
4646
}
4747

4848
/**
@@ -75,15 +75,15 @@ public function request(): Request
7575
*/
7676
public function setEntries(array $value): self
7777
{
78-
$this->Entries = $value;
78+
$this->entries = $value;
7979

8080
return $this;
8181
}
8282

8383
private function requestBody(): array
8484
{
8585
$payload = [];
86-
if (null === $v = $this->Entries) {
86+
if (null === $v = $this->entries) {
8787
throw new InvalidArgument(sprintf('Missing parameter "Entries" for "%s". The value cannot be null.', __CLASS__));
8888
}
8989

src/Result/PutEventsResponse.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ class PutEventsResponse extends Result
1111
/**
1212
* The number of failed entries.
1313
*/
14-
private $FailedEntryCount;
14+
private $failedEntryCount;
1515

1616
/**
1717
* The successfully and unsuccessfully ingested events results. If the ingestion was successful, the entry has the event
1818
* ID in it. Otherwise, you can use the error code and error message to identify the problem with the entry.
1919
*/
20-
private $Entries = [];
20+
private $entries = [];
2121

2222
/**
2323
* @return PutEventsResultEntry[]
@@ -26,22 +26,22 @@ public function getEntries(): array
2626
{
2727
$this->initialize();
2828

29-
return $this->Entries;
29+
return $this->entries;
3030
}
3131

3232
public function getFailedEntryCount(): ?int
3333
{
3434
$this->initialize();
3535

36-
return $this->FailedEntryCount;
36+
return $this->failedEntryCount;
3737
}
3838

3939
protected function populateResult(Response $response): void
4040
{
4141
$data = $response->toArray();
4242

43-
$this->FailedEntryCount = isset($data['FailedEntryCount']) ? (int) $data['FailedEntryCount'] : null;
44-
$this->Entries = empty($data['Entries']) ? [] : $this->populateResultPutEventsResultEntryList($data['Entries']);
43+
$this->failedEntryCount = isset($data['FailedEntryCount']) ? (int) $data['FailedEntryCount'] : null;
44+
$this->entries = empty($data['Entries']) ? [] : $this->populateResultPutEventsResultEntryList($data['Entries']);
4545
}
4646

4747
/**

src/ValueObject/PutEventsRequestEntry.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@ final class PutEventsRequestEntry
1212
*
1313
* @see https://www.rfc-editor.org/rfc/rfc3339.txt
1414
*/
15-
private $Time;
15+
private $time;
1616

1717
/**
1818
* The source of the event.
1919
*/
20-
private $Source;
20+
private $source;
2121

2222
/**
2323
* AWS resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. Any number, including
2424
* zero, may be present.
2525
*/
26-
private $Resources;
26+
private $resources;
2727

2828
/**
2929
* Free-form string used to decide what fields to expect in the event detail.
3030
*/
31-
private $DetailType;
31+
private $detailType;
3232

3333
/**
3434
* A valid JSON string. There is no other schema imposed. The JSON string may contain fields and nested subobjects.
3535
*/
36-
private $Detail;
36+
private $detail;
3737

3838
/**
3939
* The name or ARN of the event bus to receive the event. Only the rules that are associated with this event bus are
4040
* used to match the event. If you omit this, the default event bus is used.
4141
*/
42-
private $EventBusName;
42+
private $eventBusName;
4343

4444
/**
4545
* @param array{
@@ -53,12 +53,12 @@ final class PutEventsRequestEntry
5353
*/
5454
public function __construct(array $input)
5555
{
56-
$this->Time = $input['Time'] ?? null;
57-
$this->Source = $input['Source'] ?? null;
58-
$this->Resources = $input['Resources'] ?? null;
59-
$this->DetailType = $input['DetailType'] ?? null;
60-
$this->Detail = $input['Detail'] ?? null;
61-
$this->EventBusName = $input['EventBusName'] ?? null;
56+
$this->time = $input['Time'] ?? null;
57+
$this->source = $input['Source'] ?? null;
58+
$this->resources = $input['Resources'] ?? null;
59+
$this->detailType = $input['DetailType'] ?? null;
60+
$this->detail = $input['Detail'] ?? null;
61+
$this->eventBusName = $input['EventBusName'] ?? null;
6262
}
6363

6464
public static function create($input): self
@@ -68,35 +68,35 @@ public static function create($input): self
6868

6969
public function getDetail(): ?string
7070
{
71-
return $this->Detail;
71+
return $this->detail;
7272
}
7373

7474
public function getDetailType(): ?string
7575
{
76-
return $this->DetailType;
76+
return $this->detailType;
7777
}
7878

7979
public function getEventBusName(): ?string
8080
{
81-
return $this->EventBusName;
81+
return $this->eventBusName;
8282
}
8383

8484
/**
8585
* @return string[]
8686
*/
8787
public function getResources(): array
8888
{
89-
return $this->Resources ?? [];
89+
return $this->resources ?? [];
9090
}
9191

9292
public function getSource(): ?string
9393
{
94-
return $this->Source;
94+
return $this->source;
9595
}
9696

9797
public function getTime(): ?\DateTimeImmutable
9898
{
99-
return $this->Time;
99+
return $this->time;
100100
}
101101

102102
/**
@@ -105,27 +105,27 @@ public function getTime(): ?\DateTimeImmutable
105105
public function requestBody(): array
106106
{
107107
$payload = [];
108-
if (null !== $v = $this->Time) {
108+
if (null !== $v = $this->time) {
109109
$payload['Time'] = $v->format(\DateTimeInterface::ATOM);
110110
}
111-
if (null !== $v = $this->Source) {
111+
if (null !== $v = $this->source) {
112112
$payload['Source'] = $v;
113113
}
114-
if (null !== $v = $this->Resources) {
114+
if (null !== $v = $this->resources) {
115115
$index = -1;
116116
$payload['Resources'] = [];
117117
foreach ($v as $listValue) {
118118
++$index;
119119
$payload['Resources'][$index] = $listValue;
120120
}
121121
}
122-
if (null !== $v = $this->DetailType) {
122+
if (null !== $v = $this->detailType) {
123123
$payload['DetailType'] = $v;
124124
}
125-
if (null !== $v = $this->Detail) {
125+
if (null !== $v = $this->detail) {
126126
$payload['Detail'] = $v;
127127
}
128-
if (null !== $v = $this->EventBusName) {
128+
if (null !== $v = $this->eventBusName) {
129129
$payload['EventBusName'] = $v;
130130
}
131131

src/ValueObject/PutEventsResultEntry.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ final class PutEventsResultEntry
1010
/**
1111
* The ID of the event.
1212
*/
13-
private $EventId;
13+
private $eventId;
1414

1515
/**
1616
* The error code that indicates why the event submission failed.
1717
*/
18-
private $ErrorCode;
18+
private $errorCode;
1919

2020
/**
2121
* The error message that explains why the event submission failed.
2222
*/
23-
private $ErrorMessage;
23+
private $errorMessage;
2424

2525
/**
2626
* @param array{
@@ -31,9 +31,9 @@ final class PutEventsResultEntry
3131
*/
3232
public function __construct(array $input)
3333
{
34-
$this->EventId = $input['EventId'] ?? null;
35-
$this->ErrorCode = $input['ErrorCode'] ?? null;
36-
$this->ErrorMessage = $input['ErrorMessage'] ?? null;
34+
$this->eventId = $input['EventId'] ?? null;
35+
$this->errorCode = $input['ErrorCode'] ?? null;
36+
$this->errorMessage = $input['ErrorMessage'] ?? null;
3737
}
3838

3939
public static function create($input): self
@@ -43,16 +43,16 @@ public static function create($input): self
4343

4444
public function getErrorCode(): ?string
4545
{
46-
return $this->ErrorCode;
46+
return $this->errorCode;
4747
}
4848

4949
public function getErrorMessage(): ?string
5050
{
51-
return $this->ErrorMessage;
51+
return $this->errorMessage;
5252
}
5353

5454
public function getEventId(): ?string
5555
{
56-
return $this->EventId;
56+
return $this->eventId;
5757
}
5858
}

0 commit comments

Comments
 (0)