Skip to content

Commit 57168a7

Browse files
committed
Fix saucer typo
1 parent e088832 commit 57168a7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/UriFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private function createAuthorityFromComponents(array $components): ?Authority
113113
return new Authority(
114114
host: $components['host'],
115115
port: $components['port'],
116-
userInfo: $this->createUserInfoFromComponents($components),
116+
info: $this->createUserInfoFromComponents($components),
117117
);
118118
}
119119

@@ -122,13 +122,13 @@ private function createAuthorityFromComponents(array $components): ?Authority
122122
*/
123123
private function createUserInfoFromComponents(array $components): ?UserInfo
124124
{
125-
if (!isset($components['user']) || $components['user'] === '') {
125+
if (!isset($components['user'])) {
126126
return null;
127127
}
128128

129129
return new UserInfo(
130130
user: $components['user'],
131-
password: $components['pass'] === '' ? null : $components['pass'],
131+
password: $components['pass'],
132132
);
133133
}
134134

tests/UriFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testCreateUriFromStringWithFullUri(): void
3434
self::assertSame('https', $uri->scheme?->toString());
3535
self::assertSame('host', $uri->authority?->host);
3636
self::assertSame(8080, $uri->authority?->port);
37-
self::assertSame('user', $uri->authority?->userInfo?->user);
37+
self::assertSame('user', $uri->authority?->userInfo?->username);
3838
self::assertSame('pass', $uri->authority?->userInfo?->password);
3939
self::assertSame('/path/to/resource', $uri->path->toString());
4040
self::assertSame('foo=bar', $uri->query->toString());

0 commit comments

Comments
 (0)