@@ -20,9 +20,7 @@ final class Rules implements PublicSuffixList
2020 private const ICANN_DOMAINS = 'ICANN_DOMAINS ' ;
2121 private const PRIVATE_DOMAINS = 'PRIVATE_DOMAINS ' ;
2222 private const UNKNOWN_DOMAINS = 'UNKNOWN_DOMAINS ' ;
23-
2423 private const DOMAIN_RULE_MARKER = '? ' ;
25-
2624 private const REGEX_PSL_SECTION = ',^// ===(?<point>BEGIN|END) (?<type>ICANN|PRIVATE) DOMAINS===, ' ;
2725 private const PSL_SECTION = [
2826 'ICANN ' => [
@@ -106,8 +104,7 @@ private static function getSection(string $section, string $line): string
106104 * This method is based heavily on the code found in generateEffectiveTLDs.php
107105 *
108106 * @see https://github.com/usrflo/registered-domain-libs/blob/master/generateEffectiveTLDs.php
109- * A copy of the Apache License, Version 2.0, is provided with this
110- * distribution
107+ * A copy of the Apache License, Version 2.0, is provided with this distribution
111108 *
112109 * @param array<array> $list Initially an empty array, this eventually becomes the array representation of a
113110 * Public Suffix List section
@@ -141,14 +138,13 @@ private static function addRule(array $list, array $ruleParts): array
141138 if (isset ($ list [$ rule ]) && [] === $ list [$ rule ]) {
142139 $ list [$ rule ] = [self ::DOMAIN_RULE_MARKER => '' ];
143140 }
141+
144142 if (!isset ($ list [$ rule ])) {
145143 $ list [$ rule ] = $ isDomain ? [] : ['! ' => '' ];
146144 }
147145
148146 if ($ isDomain && [] !== $ ruleParts ) {
149- /** @var array<array-key, array> $tmpList */
150- $ tmpList = $ list [$ rule ];
151- $ list [$ rule ] = self ::addRule ($ tmpList , $ ruleParts );
147+ $ list [$ rule ] = self ::addRule ($ list [$ rule ], $ ruleParts );
152148 }
153149
154150 return $ list ;
0 commit comments