Skip to content

Commit 4358200

Browse files
committed
Improve docblock
1 parent d2e0d88 commit 4358200

File tree

4 files changed

+79
-45
lines changed

4 files changed

+79
-45
lines changed

src/Domain.php

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ public function keys(string $label): array
328328
}
329329

330330
/**
331-
* Set IDNA_* options for functions idn_to_ascii.
331+
* Gets conversion options for idn_to_ascii.
332+
*
333+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
332334
*
333335
* @see https://www.php.net/manual/en/intl.constants.php
334336
*
@@ -340,7 +342,9 @@ public function getAsciiIDNAOption(): int
340342
}
341343

342344
/**
343-
* Set IDNA_* options for functions idn_to_utf8.
345+
* Gets conversion options for idn_to_utf8.
346+
*
347+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
344348
*
345349
* @see https://www.php.net/manual/en/intl.constants.php
346350
*
@@ -352,7 +356,7 @@ public function getUnicodeIDNAOption(): int
352356
}
353357

354358
/**
355-
* return true if domain contains deviation characters.
359+
* Returns true if domain contains deviation characters.
356360
*
357361
* @see http://unicode.org/reports/tr46/#Transition_Considerations
358362
*
@@ -769,40 +773,44 @@ public function withoutLabel(int $key, int ...$keys): self
769773

770774
return new self($domain, $this->publicSuffix, $this->asciiIDNAOption, $this->unicodeIDNAOption);
771775
}
772-
776+
773777
/**
774-
* Set IDNA_* options for idn_to_ascii.
778+
* Sets conversion options for idn_to_ascii.
779+
*
780+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
775781
*
776782
* @see https://www.php.net/manual/en/intl.constants.php
777783
*
778-
* @param int $asciiIDNAOption
784+
* @param int $option
779785
*
780786
* @return self
781787
*/
782-
public function withAsciiIDNAOption(int $asciiIDNAOption): self
788+
public function withAsciiIDNAOption(int $option): self
783789
{
784-
if ($asciiIDNAOption === $this->asciiIDNAOption) {
790+
if ($option === $this->asciiIDNAOption) {
785791
return $this;
786792
}
787793

788-
return new self($this->domain, $this->publicSuffix, $asciiIDNAOption, $this->unicodeIDNAOption);
794+
return new self($this->domain, $this->publicSuffix, $option, $this->unicodeIDNAOption);
789795
}
790796

791797
/**
792-
* Set IDNA_* options for idn_to_utf8.
798+
* Sets conversion options for idn_to_utf8.
799+
*
800+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
793801
*
794802
* @see https://www.php.net/manual/en/intl.constants.php
795803
*
796-
* @param int $unicodeIDNAOption
804+
* @param int $option
797805
*
798806
* @return self
799807
*/
800-
public function withUnicodeIDNAOption(int $unicodeIDNAOption): self
808+
public function withUnicodeIDNAOption(int $option): self
801809
{
802-
if ($unicodeIDNAOption === $this->unicodeIDNAOption) {
810+
if ($option === $this->unicodeIDNAOption) {
803811
return $this;
804812
}
805813

806-
return new self($this->domain, $this->publicSuffix, $this->asciiIDNAOption, $unicodeIDNAOption);
814+
return new self($this->domain, $this->publicSuffix, $this->asciiIDNAOption, $option);
807815
}
808816
}

src/PublicSuffix.php

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ public function keys(string $label): array
256256
}
257257

258258
/**
259-
* Set IDNA_* options for functions idn_to_ascii.
259+
* Gets conversion options for idn_to_ascii.
260+
*
261+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
260262
*
261263
* @see https://www.php.net/manual/en/intl.constants.php
262264
*
@@ -268,7 +270,9 @@ public function getAsciiIDNAOption(): int
268270
}
269271

270272
/**
271-
* Set IDNA_* options for functions idn_to_utf8.
273+
* Gets conversion options for idn_to_utf8.
274+
*
275+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
272276
*
273277
* @see https://www.php.net/manual/en/intl.constants.php
274278
*
@@ -280,7 +284,7 @@ public function getUnicodeIDNAOption(): int
280284
}
281285

282286
/**
283-
* return true if domain contains deviation characters.
287+
* Returns true if domain contains deviation characters.
284288
*
285289
* @see http://unicode.org/reports/tr46/#Transition_Considerations
286290
*
@@ -359,38 +363,42 @@ public function toUnicode()
359363
}
360364

361365
/**
362-
* Set IDNA_* options for idn_to_ascii.
366+
* Sets conversion options for idn_to_ascii.
367+
*
368+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
363369
*
364370
* @see https://www.php.net/manual/en/intl.constants.php
365371
*
366-
* @param int $asciiIDNAOption
372+
* @param int $option
367373
*
368374
* @return self
369375
*/
370-
public function withAsciiIDNAOption(int $asciiIDNAOption): self
376+
public function withAsciiIDNAOption(int $option): self
371377
{
372-
if ($asciiIDNAOption === $this->asciiIDNAOption) {
378+
if ($option === $this->asciiIDNAOption) {
373379
return $this;
374380
}
375381

376-
return new self($this->publicSuffix, $this->section, $asciiIDNAOption, $this->unicodeIDNAOption);
382+
return new self($this->publicSuffix, $this->section, $option, $this->unicodeIDNAOption);
377383
}
378384

379385
/**
380-
* Set IDNA_* options for idn_to_utf8.
386+
* Sets conversion options for idn_to_utf8.
387+
*
388+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
381389
*
382390
* @see https://www.php.net/manual/en/intl.constants.php
383391
*
384-
* @param int $unicodeIDNAOption
392+
* @param int $option
385393
*
386394
* @return self
387395
*/
388-
public function withUnicodeIDNAOption(int $unicodeIDNAOption): self
396+
public function withUnicodeIDNAOption(int $option): self
389397
{
390-
if ($unicodeIDNAOption === $this->unicodeIDNAOption) {
398+
if ($option === $this->unicodeIDNAOption) {
391399
return $this;
392400
}
393401

394-
return new self($this->publicSuffix, $this->section, $this->asciiIDNAOption, $unicodeIDNAOption);
402+
return new self($this->publicSuffix, $this->section, $this->asciiIDNAOption, $option);
395403
}
396404
}

src/Rules.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ public static function __set_state(array $properties): self
144144
}
145145

146146
/**
147-
* Set IDNA_* options for functions idn_to_ascii.
147+
* Gets conversion options for idn_to_ascii.
148+
*
149+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
148150
*
149151
* @see https://www.php.net/manual/en/intl.constants.php
150152
*
@@ -156,7 +158,9 @@ public function getAsciiIDNAOption(): int
156158
}
157159

158160
/**
159-
* Set IDNA_* options for functions idn_to_utf8.
161+
* Gets conversion options for idn_to_utf8.
162+
*
163+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
160164
*
161165
* @see https://www.php.net/manual/en/intl.constants.php
162166
*
@@ -193,8 +197,10 @@ public function getPublicSuffix($domain, string $section = self::ALL_DOMAINS): P
193197

194198
/**
195199
* Returns PSL info for a given domain.
196-
* @param mixed $domain
197-
* @param string $section
200+
*
201+
* @param mixed $domain
202+
* @param string $section
203+
*
198204
* @return Domain
199205
*/
200206
public function resolve($domain, string $section = self::ALL_DOMAINS): Domain
@@ -310,7 +316,9 @@ private function findPublicSuffixFromSection(DomainInterface $domain, string $se
310316
}
311317

312318
/**
313-
* Set IDNA_* options for idn_to_ascii.
319+
* Sets conversion options for idn_to_ascii.
320+
*
321+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
314322
*
315323
* @see https://www.php.net/manual/en/intl.constants.php
316324
*
@@ -331,7 +339,9 @@ public function withAsciiIDNAOption(int $asciiIDNAOption): self
331339
}
332340

333341
/**
334-
* Set IDNA_* options for idn_to_utf8.
342+
* Sets conversion options for idn_to_utf8.
343+
*
344+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
335345
*
336346
* @see https://www.php.net/manual/en/intl.constants.php
337347
*

src/TopLevelDomains.php

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ public function getModifiedDate(): DateTimeImmutable
177177
}
178178

179179
/**
180-
* Set IDNA_* options for functions idn_to_ascii.
180+
* Gets conversion options for idn_to_ascii.
181+
*
182+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
181183
*
182184
* @see https://www.php.net/manual/en/intl.constants.php
183185
*
@@ -189,7 +191,9 @@ public function getAsciiIDNAOption(): int
189191
}
190192

191193
/**
192-
* Set IDNA_* options for functions idn_to_utf8.
194+
* Gets conversion options for idn_to_utf8.
195+
*
196+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
193197
*
194198
* @see https://www.php.net/manual/en/intl.constants.php
195199
*
@@ -311,43 +315,47 @@ public function resolve($domain): Domain
311315
}
312316

313317
/**
314-
* Set IDNA_* options for idn_to_ascii.
318+
* Sets conversion options for idn_to_ascii.
319+
*
320+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
315321
*
316322
* @see https://www.php.net/manual/en/intl.constants.php
317323
*
318-
* @param int $asciiIDNAOption
324+
* @param int $option
319325
*
320326
* @return self
321327
*/
322-
public function withAsciiIDNAOption(int $asciiIDNAOption): self
328+
public function withAsciiIDNAOption(int $option): self
323329
{
324-
if ($asciiIDNAOption === $this->asciiIDNAOption) {
330+
if ($option === $this->asciiIDNAOption) {
325331
return $this;
326332
}
327333

328334
$clone = clone $this;
329-
$clone->asciiIDNAOption = $asciiIDNAOption;
335+
$clone->asciiIDNAOption = $option;
330336

331337
return $clone;
332338
}
333339

334340
/**
335-
* Set IDNA_* options for idn_to_utf8.
341+
* Sets conversion options for idn_to_utf8.
342+
*
343+
* combination of IDNA_* constants (except IDNA_ERROR_* constants).
336344
*
337345
* @see https://www.php.net/manual/en/intl.constants.php
338346
*
339-
* @param int $unicodeIDNAOption
347+
* @param int $option
340348
*
341349
* @return self
342350
*/
343-
public function withUnicodeIDNAOption(int $unicodeIDNAOption): self
351+
public function withUnicodeIDNAOption(int $option): self
344352
{
345-
if ($unicodeIDNAOption === $this->unicodeIDNAOption) {
353+
if ($option === $this->unicodeIDNAOption) {
346354
return $this;
347355
}
348356

349357
$clone = clone $this;
350-
$clone->unicodeIDNAOption = $unicodeIDNAOption;
358+
$clone->unicodeIDNAOption = $option;
351359

352360
return $clone;
353361
}

0 commit comments

Comments
 (0)