Skip to content

Commit 9cd9ec8

Browse files
authored
Few Optimization (#321)
1 parent 8b4d4f5 commit 9cd9ec8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Sts/Input/AssumeRoleRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ public function __construct(array $input = [])
129129
{
130130
$this->RoleArn = $input['RoleArn'] ?? null;
131131
$this->RoleSessionName = $input['RoleSessionName'] ?? null;
132-
$this->PolicyArns = array_map(function ($item) { return PolicyDescriptorType::create($item); }, $input['PolicyArns'] ?? []);
132+
$this->PolicyArns = array_map([PolicyDescriptorType::class, 'create'], $input['PolicyArns'] ?? []);
133133
$this->Policy = $input['Policy'] ?? null;
134134
$this->DurationSeconds = $input['DurationSeconds'] ?? null;
135-
$this->Tags = array_map(function ($item) { return Tag::create($item); }, $input['Tags'] ?? []);
135+
$this->Tags = array_map([Tag::class, 'create'], $input['Tags'] ?? []);
136136
$this->TransitiveTagKeys = $input['TransitiveTagKeys'] ?? [];
137137
$this->ExternalId = $input['ExternalId'] ?? null;
138138
$this->SerialNumber = $input['SerialNumber'] ?? null;

src/Sts/Input/AssumeRoleWithWebIdentityRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function __construct(array $input = [])
9393
$this->RoleSessionName = $input['RoleSessionName'] ?? null;
9494
$this->WebIdentityToken = $input['WebIdentityToken'] ?? null;
9595
$this->ProviderId = $input['ProviderId'] ?? null;
96-
$this->PolicyArns = array_map(function ($item) { return PolicyDescriptorType::create($item); }, $input['PolicyArns'] ?? []);
96+
$this->PolicyArns = array_map([PolicyDescriptorType::class, 'create'], $input['PolicyArns'] ?? []);
9797
$this->Policy = $input['Policy'] ?? null;
9898
$this->DurationSeconds = $input['DurationSeconds'] ?? null;
9999
}

0 commit comments

Comments
 (0)