Skip to content

Commit f67a685

Browse files
committed
deprecate IDNAConverterTrait::setLabels
1 parent c0d563c commit f67a685

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All Notable changes to `PHP Domain Parser` **5.x** series will be documented in this file
44

5-
# 5.5.0 - 2019-04-13
5+
# 5.5.0 - 2019-04-14
66

77
### Added
88

@@ -19,11 +19,11 @@ All Notable changes to `PHP Domain Parser` **5.x** series will be documented in
1919

2020
### Deprecated
2121

22-
- None
22+
- `IDNAConverterTrait::setLabels` replaced by `IDNAConverterTrait::parse` (internal)
2323

2424
### Removed
2525

26-
- IDNAConverterTrait::setLabels (internal)
26+
- None
2727

2828
# 5.4.0 - 2018-11-22
2929

src/IDNAConverterTrait.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,30 @@ private function idnToUnicode(string $domain, int $option = IDNA_DEFAULT): strin
188188
* Filter and format the domain to ensure it is valid.
189189
* Returns an array containing the formatted domain name in lowercase
190190
* with its associated labels in reverse order
191-
* For example: parse('wWw.uLb.Ac.be') should return ['www.ulb.ac.be', ['be', 'ac', 'ulb', 'www']];.
191+
* For example: parse('wWw.uLb.Ac.be') should return ['be', 'ac', 'ulb', 'www'];.
192+
*
193+
* @deprecated
194+
*
195+
* @codeCoverageIgnore
196+
*
197+
* @param mixed $domain
198+
*
199+
* @throws InvalidDomain If the domain is invalid
200+
*
201+
* @return string[]
202+
*/
203+
private function setLabels($domain = null): array
204+
{
205+
return $this->parse($domain, IDNA_DEFAULT, IDNA_DEFAULT)['labels'];
206+
}
207+
208+
/**
209+
* Parse and format the domain to ensure it is valid.
210+
* Returns an array containing the formatted domain name labels
211+
* and the domain transitional information.
212+
*
213+
* For example: parse('wWw.uLb.Ac.be') should return
214+
* ['labels' => ['be', 'ac', 'ulb', 'www'], 'isTransitionalDifferant' => false];.
192215
*
193216
* @param mixed $domain
194217
* @param int $asciiOption

0 commit comments

Comments
 (0)