@@ -421,7 +421,7 @@ public function toAscii()
421
421
return $ this ;
422
422
}
423
423
424
- return new self ($ domain , $ this ->publicSuffix , ... $ this ->getIDNAOptions ());
424
+ return new self ($ domain , $ this ->publicSuffix , $ this ->getAsciiIDNAOption (), $ this -> getUnicodeIDNAOption ());
425
425
}
426
426
427
427
/**
@@ -436,7 +436,8 @@ public function toUnicode()
436
436
return new self (
437
437
$ this ->idnToUnicode ($ this ->domain , $ this ->unicodeIDNAOption ),
438
438
$ this ->publicSuffix ,
439
- ...$ this ->getIDNAOptions ()
439
+ $ this ->getAsciiIDNAOption (),
440
+ $ this ->getUnicodeIDNAOption ()
440
441
);
441
442
}
442
443
@@ -458,15 +459,20 @@ public function toUnicode()
458
459
public function resolve ($ publicSuffix ): self
459
460
{
460
461
if (!$ publicSuffix instanceof PublicSuffix) {
461
- $ publicSuffix = new PublicSuffix ($ publicSuffix , '' , ...$ this ->getIDNAOptions ());
462
+ $ publicSuffix = new PublicSuffix (
463
+ $ publicSuffix ,
464
+ '' ,
465
+ $ this ->getAsciiIDNAOption (),
466
+ $ this ->getUnicodeIDNAOption ()
467
+ );
462
468
}
463
469
464
470
$ publicSuffix = $ this ->normalize ($ publicSuffix );
465
471
if ($ this ->publicSuffix == $ publicSuffix ) {
466
472
return $ this ;
467
473
}
468
474
469
- return new self ($ this ->domain , $ publicSuffix , ... $ this ->getIDNAOptions ());
475
+ return new self ($ this ->domain , $ publicSuffix , $ this ->getAsciiIDNAOption (), $ this -> getUnicodeIDNAOption ());
470
476
}
471
477
472
478
/**
@@ -485,7 +491,12 @@ public function resolve($publicSuffix): self
485
491
public function withPublicSuffix ($ publicSuffix ): self
486
492
{
487
493
if (!$ publicSuffix instanceof PublicSuffix) {
488
- $ publicSuffix = new PublicSuffix ($ publicSuffix , '' , ...$ this ->getIDNAOptions ());
494
+ $ publicSuffix = new PublicSuffix (
495
+ $ publicSuffix ,
496
+ '' ,
497
+ $ this ->getAsciiIDNAOption (),
498
+ $ this ->getUnicodeIDNAOption ()
499
+ );
489
500
}
490
501
491
502
$ publicSuffix = $ this ->normalize ($ publicSuffix );
@@ -495,10 +506,15 @@ public function withPublicSuffix($publicSuffix): self
495
506
496
507
$ domain = implode ('. ' , array_reverse (array_slice ($ this ->labels , count ($ this ->publicSuffix ))));
497
508
if (null === $ publicSuffix ->getContent ()) {
498
- return new self ($ domain , null , ... $ this ->getIDNAOptions ());
509
+ return new self ($ domain , null , $ this ->getAsciiIDNAOption (), $ this -> getUnicodeIDNAOption ());
499
510
}
500
511
501
- return new self ($ domain .'. ' .$ publicSuffix ->getContent (), $ publicSuffix , ...$ this ->getIDNAOptions ());
512
+ return new self (
513
+ $ domain .'. ' .$ publicSuffix ->getContent (),
514
+ $ publicSuffix ,
515
+ $ this ->getAsciiIDNAOption (),
516
+ $ this ->getUnicodeIDNAOption ()
517
+ );
502
518
}
503
519
504
520
@@ -526,13 +542,19 @@ public function withSubDomain($subDomain): self
526
542
}
527
543
528
544
if (null === $ subDomain ) {
529
- return new self ($ this ->registrableDomain , $ this ->publicSuffix , ...$ this ->getIDNAOptions ());
545
+ return new self (
546
+ $ this ->registrableDomain ,
547
+ $ this ->publicSuffix ,
548
+ $ this ->getAsciiIDNAOption (),
549
+ $ this ->getUnicodeIDNAOption ()
550
+ );
530
551
}
531
552
532
553
return new self (
533
554
$ subDomain .'. ' .$ this ->registrableDomain ,
534
555
$ this ->publicSuffix ,
535
- ...$ this ->getIDNAOptions ()
556
+ $ this ->getAsciiIDNAOption (),
557
+ $ this ->getUnicodeIDNAOption ()
536
558
);
537
559
}
538
560
@@ -641,13 +663,19 @@ public function withLabel(int $key, $label): self
641
663
ksort ($ labels );
642
664
643
665
if (null !== $ this ->publicSuffix ->getLabel ($ key )) {
644
- return new self (implode ('. ' , array_reverse ($ labels )), null , ...$ this ->getIDNAOptions ());
666
+ return new self (
667
+ implode ('. ' , array_reverse ($ labels )),
668
+ null ,
669
+ $ this ->getAsciiIDNAOption (),
670
+ $ this ->getUnicodeIDNAOption ()
671
+ );
645
672
}
646
673
647
674
return new self (
648
675
implode ('. ' , array_reverse ($ labels )),
649
676
$ this ->publicSuffix ,
650
- ...$ this ->getIDNAOptions ()
677
+ $ this ->getAsciiIDNAOption (),
678
+ $ this ->getUnicodeIDNAOption ()
651
679
);
652
680
}
653
681
@@ -691,25 +719,18 @@ public function withoutLabel(int $key, int ...$keys): self
691
719
}
692
720
693
721
if ([] === $ labels ) {
694
- return new self (null , null , ... $ this ->getIDNAOptions ());
722
+ return new self (null , null , $ this ->getAsciiIDNAOption (), $ this -> getUnicodeIDNAOption ());
695
723
}
696
724
697
725
$ domain = implode ('. ' , array_reverse ($ labels ));
698
726
$ psContent = $ this ->publicSuffix ->getContent ();
699
727
if (null === $ psContent || '. ' .$ psContent !== substr ($ domain , - strlen ($ psContent ) - 1 )) {
700
- return new self ($ domain , null , ... $ this ->getIDNAOptions ());
728
+ return new self ($ domain , null , $ this ->getAsciiIDNAOption (), $ this -> getUnicodeIDNAOption ());
701
729
}
702
730
703
- return new self ($ domain , $ this ->publicSuffix , ... $ this ->getIDNAOptions ());
731
+ return new self ($ domain , $ this ->publicSuffix , $ this ->getAsciiIDNAOption (), $ this -> getUnicodeIDNAOption ());
704
732
}
705
733
706
- /**
707
- * @return array
708
- */
709
- public function getIDNAOptions (): array
710
- {
711
- return [$ this ->asciiIDNAOption , $ this ->unicodeIDNAOption ];
712
- }
713
734
714
735
public function getAsciiIDNAOption (): int
715
736
{
0 commit comments