Skip to content

Commit 0b5f360

Browse files
committed
Improve and simplify codebase
1 parent 7a7fea9 commit 0b5f360

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

IPv4/Converter.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ final class Converter
4242
'/^(?<number>\d+)$/' => 10,
4343
];
4444

45-
private readonly mixed $maxIpv4Number;
45+
private readonly mixed $maxIPv4Number;
4646

4747
public function __construct(
4848
private readonly Calculator $calculator
4949
) {
50-
$this->maxIpv4Number = $calculator->sub($calculator->pow(2, 32), 1);
50+
$this->maxIPv4Number = $calculator->sub($calculator->pow(2, 32), 1);
5151
}
5252

5353
/**
@@ -170,7 +170,7 @@ public function toDecimal(Stringable|string|null $host): ?string
170170
*
171171
* @see https://url.spec.whatwg.org/#ipv4-number-parser
172172
*
173-
* @return mixed Returns null if it can not correctly convert the label
173+
* @return mixed returns null if it can not correctly convert the label
174174
*/
175175
private function labelToNumber(string $label): mixed
176176
{
@@ -185,7 +185,7 @@ private function labelToNumber(string $label): mixed
185185
}
186186

187187
$number = $this->calculator->baseConvert($number, $base);
188-
if (0 <= $this->calculator->compare($number, 0) && 0 >= $this->calculator->compare($number, $this->maxIpv4Number)) {
188+
if (0 <= $this->calculator->compare($number, 0) && 0 >= $this->calculator->compare($number, $this->maxIPv4Number)) {
189189
return $number;
190190
}
191191
}

UriString.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
* @author Ignace Nyamagana Butera <[email protected]>
3939
* @since 6.0.0
4040
*
41+
* @phpstan-type AuthorityMap array{user:?string, pass:?string, host:?string, port:?int}
4142
* @phpstan-type ComponentMap array{scheme:?string, user:?string, pass:?string, host:?string, port:?int, path:string, query:?string, fragment:?string}
4243
* @phpstan-type InputComponentMap array{scheme? : ?string, user? : ?string, pass? : ?string, host? : ?string, port? : ?int, path? : ?string, query? : ?string, fragment? : ?string}
43-
* @phpstan-type AuthorityMap array{user:?string, pass:?string, host:?string, port:?int}
4444
*/
4545
final class UriString
4646
{

0 commit comments

Comments
 (0)