@@ -20,9 +20,7 @@ final class Rules implements PublicSuffixList
20
20
private const ICANN_DOMAINS = 'ICANN_DOMAINS ' ;
21
21
private const PRIVATE_DOMAINS = 'PRIVATE_DOMAINS ' ;
22
22
private const UNKNOWN_DOMAINS = 'UNKNOWN_DOMAINS ' ;
23
-
24
23
private const DOMAIN_RULE_MARKER = '? ' ;
25
-
26
24
private const REGEX_PSL_SECTION = ',^// ===(?<point>BEGIN|END) (?<type>ICANN|PRIVATE) DOMAINS===, ' ;
27
25
private const PSL_SECTION = [
28
26
'ICANN ' => [
@@ -106,8 +104,7 @@ private static function getSection(string $section, string $line): string
106
104
* This method is based heavily on the code found in generateEffectiveTLDs.php
107
105
*
108
106
* @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
111
108
*
112
109
* @param array<array> $list Initially an empty array, this eventually becomes the array representation of a
113
110
* Public Suffix List section
@@ -141,14 +138,13 @@ private static function addRule(array $list, array $ruleParts): array
141
138
if (isset ($ list [$ rule ]) && [] === $ list [$ rule ]) {
142
139
$ list [$ rule ] = [self ::DOMAIN_RULE_MARKER => '' ];
143
140
}
141
+
144
142
if (!isset ($ list [$ rule ])) {
145
143
$ list [$ rule ] = $ isDomain ? [] : ['! ' => '' ];
146
144
}
147
145
148
146
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 );
152
148
}
153
149
154
150
return $ list ;
0 commit comments