Skip to content

Commit a986b61

Browse files
committed
Actualize CI
1 parent 50ace09 commit a986b61

File tree

6 files changed

+14
-81
lines changed

6 files changed

+14
-81
lines changed

src/Component/Authority.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,9 @@
99

1010
final class Authority implements AuthorityInterface
1111
{
12-
/**
13-
* @var non-empty-string
14-
*/
15-
public const string AUTHORITY_HOST_PORT_DELIMITER = ':';
16-
17-
/**
18-
* @var non-empty-string
19-
*/
20-
public const string AUTHORITY_USER_INFO_DELIMITER = '@';
21-
2212
/**
2313
* Gets the user component of the URI.
2414
*
25-
* @uses \Boson\Contracts\Uri\Component\UserInfoInterface::$user
26-
*
2715
* @var non-empty-string|null
2816
*/
2917
public ?string $user {
@@ -33,8 +21,6 @@ final class Authority implements AuthorityInterface
3321
/**
3422
* Gets the password component of the URI.
3523
*
36-
* @uses \Boson\Contracts\Uri\Component\UserInfoInterface::$password
37-
*
3824
* @var non-empty-string|null
3925
*/
4026
public ?string $password {
@@ -73,11 +59,11 @@ public function __toString(): string
7359
$result = $this->host;
7460

7561
if ($this->port !== null) {
76-
$result .= self::AUTHORITY_HOST_PORT_DELIMITER . $this->port;
62+
$result .= ':' . $this->port;
7763
}
7864

7965
if ($this->userInfo !== null) {
80-
return $this->userInfo . self::AUTHORITY_USER_INFO_DELIMITER . $result;
66+
return $this->userInfo . '@' . $result;
8167
}
8268

8369
return $result;

src/Component/Path.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
*/
1212
final readonly class Path implements PathInterface, \IteratorAggregate
1313
{
14-
/**
15-
* Provides segment delimiter of the path component.
16-
*
17-
* @var non-empty-string
18-
*/
19-
public const string PATH_SEGMENT_DELIMITER = '/';
20-
2114
/**
2215
* @var list<non-empty-string>
2316
*/
@@ -67,14 +60,14 @@ public function __toString(): string
6760
$segments[] = \rawurlencode($segment);
6861
}
6962

70-
$path = \implode(self::PATH_SEGMENT_DELIMITER, $segments);
63+
$path = \implode('/', $segments);
7164

7265
if ($this->isAbsolute) {
73-
$path = self::PATH_SEGMENT_DELIMITER . $path;
66+
$path = '/' . $path;
7467
}
7568

7669
if ($segments !== [] && $this->hasTrailingSlash) {
77-
$path .= self::PATH_SEGMENT_DELIMITER;
70+
$path .= '/';
7871
}
7972

8073
return $path;

src/Component/Query.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@
1111
*/
1212
final class Query implements QueryInterface, \IteratorAggregate
1313
{
14-
/**
15-
* @var non-empty-string
16-
*/
17-
public const string QUERY_PARAMETER_VALUE_DELIMITER = '=';
18-
19-
/**
20-
* @var non-empty-string
21-
*/
22-
public const string QUERY_PARAMETER_DELIMITER = '&';
23-
2414
/**
2515
* @var array<non-empty-string, string|array<array-key, string>>
2616
*/
@@ -113,12 +103,12 @@ public function __toString(): string
113103
$result = [];
114104

115105
foreach ($this as $key => $value) {
116-
/** @phpstan-ignore-next-line : PHPStan false-positive. PHP may contain integer keys in array */
106+
/** @phpstan-ignore-next-line PHPStan false-positive. PHP may contain integer keys in array */
117107
$result[] = \rawurlencode((string) $key)
118-
. self::QUERY_PARAMETER_VALUE_DELIMITER
108+
. '='
119109
. \rawurlencode($value);
120110
}
121111

122-
return \implode(self::QUERY_PARAMETER_DELIMITER, $result);
112+
return \implode('&', $result);
123113
}
124114
}

src/Component/Scheme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/**
3737
* Hypertext Transfer Protocol Secure (HTTPS) is an extension of the
3838
* Hypertext Transfer Protocol (HTTP). It uses encryption for secure
39-
* communication over a computer network, and is widely used on the Internet.
39+
* communication over a computer network and is widely used on the Internet.
4040
*
4141
* In HTTPS, the communication protocol is encrypted using Transport
4242
* Layer Security (TLS) or, formerly, Secure Sockets Layer (SSL).

src/Component/UserInfo.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
final readonly class UserInfo implements UserInfoInterface
1010
{
11-
/**
12-
* @var non-empty-string
13-
*/
14-
public const string USER_INFO_USER_PASSWORD_DELIMITER = ':';
15-
1611
public function __construct(
1712
/**
1813
* @var non-empty-string
@@ -43,9 +38,7 @@ public function toString(): string
4338
public function __toString(): string
4439
{
4540
if ($this->password !== null) {
46-
return $this->user
47-
. self::USER_INFO_USER_PASSWORD_DELIMITER
48-
. $this->password;
41+
return $this->user . ':' . $this->password;
4942
}
5043

5144
return $this->user;

src/Uri.php

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,9 @@
1414

1515
final class Uri implements UriInterface
1616
{
17-
/**
18-
* @var non-empty-string
19-
*/
20-
public const string URI_SCHEMA_SUFFIX = ':';
21-
22-
/**
23-
* @var non-empty-string
24-
*/
25-
public const string URI_AUTHORITY_PREFIX = '//';
26-
27-
/**
28-
* @var non-empty-string
29-
*/
30-
public const string URI_QUERY_PREFIX = '?';
31-
32-
/**
33-
* @var non-empty-string
34-
*/
35-
public const string URI_FRAGMENT_PREFIX = '#';
36-
3717
/**
3818
* Gets the user component of the URI.
3919
*
40-
* @uses \Boson\Contracts\Uri\Component\UserInfoInterface::$user
41-
*
4220
* @var non-empty-string|null
4321
*/
4422
public ?string $user {
@@ -48,8 +26,6 @@ final class Uri implements UriInterface
4826
/**
4927
* Gets the password component of the URI.
5028
*
51-
* @uses \Boson\Contracts\Uri\Component\UserInfoInterface::$password
52-
*
5329
* @var non-empty-string|null
5430
*/
5531
public ?string $password {
@@ -59,8 +35,6 @@ final class Uri implements UriInterface
5935
/**
6036
* Gets the host component of the URI.
6137
*
62-
* @uses \Boson\Contracts\Uri\Component\AuthorityInterface::$host
63-
*
6438
* @var non-empty-string|null
6539
*/
6640
public ?string $host {
@@ -70,8 +44,6 @@ final class Uri implements UriInterface
7044
/**
7145
* Gets the port component of the URI.
7246
*
73-
* @uses \Boson\Contracts\Uri\Component\AuthorityInterface::$port
74-
*
7547
* @var int<0, 65535>|null
7648
*/
7749
public ?int $port {
@@ -116,22 +88,21 @@ public function __toString(): string
11688
$result = '';
11789

11890
if ($this->scheme !== null) {
119-
$result .= $this->scheme . self::URI_SCHEMA_SUFFIX;
91+
$result .= $this->scheme . ':';
12092
}
12193

12294
if ($this->authority !== null) {
123-
$result .= self::URI_AUTHORITY_PREFIX
124-
. $this->authority;
95+
$result .= '//' . $this->authority;
12596
}
12697

12798
$result .= $this->path;
12899

129100
if ($this->query->count() !== 0) {
130-
$result .= self::URI_QUERY_PREFIX . $this->query;
101+
$result .= '?' . $this->query;
131102
}
132103

133104
if ($this->fragment !== null) {
134-
$result .= self::URI_FRAGMENT_PREFIX . \rawurlencode($this->fragment);
105+
$result .= '#' . \rawurlencode($this->fragment);
135106
}
136107

137108
return $result;

0 commit comments

Comments
 (0)