Skip to content

Commit 29297a2

Browse files
committed
Fixes #29 -- Update name for "new password" on user API.
1 parent 7619ff0 commit 29297a2

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

src/AbstractClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public function request(
5151
string $uri = '',
5252
array $options = []
5353
) {
54+
55+
5456
$response = $this->httpClient->request($method, $uri, $options);
5557

5658
if (403 === $response->getStatusCode()) {

src/Admin/UsersClient.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function get(int $userId): Dto\UserDto
4848

4949
/**
5050
* @param string $email
51-
* @param string $authPassword
51+
* @param string $newPassword
5252
* @param string $name
5353
* @param string $locale
5454
* @param string $theme
@@ -62,7 +62,7 @@ public function get(int $userId): Dto\UserDto
6262
*/
6363
public function create(
6464
string $email,
65-
string $authPassword,
65+
string $newPassword,
6666
string $name,
6767
string $locale,
6868
string $theme,
@@ -81,7 +81,7 @@ public function create(
8181
$apiKeys,
8282
new Dto\LinksDto('')
8383
);
84-
$userDto->setAuthPassword($authPassword);
84+
$userDto->setNewPassword($newPassword);
8585

8686
$userData = $this->request(
8787
'POST',
@@ -95,7 +95,7 @@ public function create(
9595
/**
9696
* @param int $userId
9797
* @param string $email
98-
* @param string $authPassword
98+
* @param string $newPassword
9999
* @param string $name
100100
* @param string $locale
101101
* @param string $theme
@@ -110,7 +110,7 @@ public function create(
110110
public function update(
111111
int $userId,
112112
string $email,
113-
string $authPassword,
113+
string $newPassword,
114114
string $name,
115115
string $locale,
116116
string $theme,
@@ -129,8 +129,8 @@ public function update(
129129
$apiKeys,
130130
new Dto\LinksDto('')
131131
);
132-
if ($authPassword !== '') {
133-
$userDto->setAuthPassword($authPassword);
132+
if ($newPassword !== '') {
133+
$userDto->setNewPassword($newPassword);
134134
}
135135

136136
$this->request(
@@ -139,7 +139,7 @@ public function update(
139139
['json' => $userDto]
140140
);
141141

142-
$userDto->setAuthPassword('');
142+
$userDto->setNewPassword('');
143143
return $userDto;
144144
}
145145

src/Dto/UserDto.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UserDto implements JsonSerializable
2020
/**
2121
* @var string
2222
*/
23-
protected $authPassword;
23+
protected $newPassword;
2424

2525
/**
2626
* @var string
@@ -88,7 +88,7 @@ public function __construct(
8888
) {
8989
$this->setId($id)
9090
->setEmail($email)
91-
->setAuthPassword('')
91+
->setNewPassword('')
9292
->setName($name)
9393
->setLocale($locale)
9494
->setTheme($theme)
@@ -142,19 +142,19 @@ public function setEmail(string $email): UserDto
142142
/**
143143
* @return string
144144
*/
145-
public function getAuthPassword(): string
145+
public function getNewPassword(): string
146146
{
147-
return $this->authPassword;
147+
return $this->newPassword;
148148
}
149149

150150
/**
151-
* @param string $authPassword
151+
* @param string $newPassword
152152
*
153153
* @return UserDto
154154
*/
155-
public function setAuthPassword(string $authPassword): UserDto
155+
public function setNewPassword(string $newPassword): UserDto
156156
{
157-
$this->authPassword = $authPassword;
157+
$this->newPassword = $newPassword;
158158

159159
return $this;
160160
}
@@ -351,7 +351,7 @@ public function jsonSerialize(): array
351351
return [
352352
'id' => $this->getId(),
353353
'email' => $this->getEmail(),
354-
'auth_password' => $this->getAuthPassword(),
354+
'auth_password' => $this->getNewPassword(),
355355
'name' => $this->getName(),
356356
'locale' => $this->getLocale(),
357357
'theme' => $this->getTheme(),

0 commit comments

Comments
 (0)