Skip to content

Commit ca9b516

Browse files
committed
update components method name
1 parent 3308e15 commit ca9b516

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

components/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All Notable changes to `League\Uri\Components` will be documented in this file
1010
- `URLSearchParams::when` conditional method to ease component building logic.
1111
- `Modifier::prependQueryParameters` returns a modifier with prepend query paramters
1212
- `Modifier::when` conditional method to ease component building logic.
13-
- `Modifier::whatWgHost` returns the host as normalized by the WHATWG algorithm
13+
- `Modifier::normalizeHostIp` returns the host as normalized by the WHATWG algorithm
1414
- `Modifier::with*` method from the underlying `Uri` object are proxy to improve DX.
1515
- `Query::decoded` the string representation of the component decoded.
1616
- `URLSearchParams::decoded` the string representation of the component decoded.

components/Modifier.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ public function replaceLabel(int $offset, Stringable|string|null $label): static
657657
return new static($this->uri->withHost(static::normalizeComponent($newHost, $this->uri)));
658658
}
659659

660-
public function useWhatwgHost(): static
660+
public function normalizeHostIp(): static
661661
{
662662
$host = $this->uri->getHost();
663663
try {

components/ModifierTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ public function it_will_convert_uri_host_following_whatwg_rules(): void
890890
self::assertSame(
891891
'192.168.2.13',
892892
Modifier::from(Http::new('https://0:0@0xc0a8020d/0?0#0'))
893-
->useWhatwgHost()
893+
->normalizeHostIp()
894894
->getUri()
895895
->getHost()
896896
);

docs/components/7.0/modifiers.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ to apply the following changes to the submitted URI.
142142
<li><a href="#modifierreplacelabel">replaceLabel</a></li>
143143
<li><a href="#modifierremovelabels">removeLabels</a></li>
144144
<li><a href="#modifierslicelabels">sliceLabels</a></li>
145-
<li><a href="#modifierwhatwgHost">useWhatwgHost</a></li>
145+
<li><a href="#modifiernormalizehostip">normalizeHostIp</a></li>
146146
</ul>
147147
</div>
148148
<div>
@@ -602,15 +602,15 @@ echo Modifier::from($uri)->sliceLabels(1, 1)->getUriString();
602602

603603
<p class="message-info">This modifier supports negative offset</p>
604604

605-
### Modifier::useWhatwgHost
605+
### Modifier::normalizeHostIp
606606

607607
Returns the host as formatted following WHATWG host formatting
608608

609609
<p class="message-notice">available since version <code>7.6.0</code></p>
610610

611611
~~~php
612612
$uri = "https://0:0@0:0";
613-
echo Modifier::from($uri)->useWhatwgHost()->getUriString();
613+
echo Modifier::from($uri)->normalizeHostIp()->getUriString();
614614
//display "https://0:[email protected]:0"
615615
~~~
616616

0 commit comments

Comments
 (0)