@@ -124,7 +124,8 @@ public function allows(string $url, ?string $userAgent = '*'): bool
124
124
return ! $ isDenied ;
125
125
}
126
126
127
- public function crawlDelay (string $ userAgent = '* ' ): ?string {
127
+ public function crawlDelay (string $ userAgent = '* ' ): ?string
128
+ {
128
129
$ crawlDelaysPerUserAgent = $ this ->includeGlobalGroup
129
130
? $ this ->crawlDelaysPerUserAgent
130
131
: array_filter ($ this ->crawlDelaysPerUserAgent , fn ($ key ) => $ key !== '* ' , ARRAY_FILTER_USE_KEY );
@@ -133,9 +134,10 @@ public function crawlDelay(string $userAgent = '*'): ?string {
133
134
134
135
if (isset ($ crawlDelaysPerUserAgent [$ normalizedUserAgent ])) {
135
136
return $ crawlDelaysPerUserAgent [$ normalizedUserAgent ];
136
- } else if (isset ($ crawlDelaysPerUserAgent ['* ' ])) {
137
+ } elseif (isset ($ crawlDelaysPerUserAgent ['* ' ])) {
137
138
return $ crawlDelaysPerUserAgent ['* ' ];
138
139
}
140
+
139
141
return null ;
140
142
}
141
143
@@ -350,7 +352,8 @@ protected function getAllowsPerUserAgent(string $content): array
350
352
return $ allowsPerUserAgent ;
351
353
}
352
354
353
- protected function getCrawlDelaysPerUserAgent (string $ content ): array {
355
+ protected function getCrawlDelaysPerUserAgent (string $ content ): array
356
+ {
354
357
$ lines = explode (PHP_EOL , $ content );
355
358
356
359
$ lines = array_filter ($ lines );
@@ -370,7 +373,7 @@ protected function getCrawlDelaysPerUserAgent(string $content): array {
370
373
}
371
374
372
375
if ($ this ->isUserAgentLine ($ line )) {
373
- if (!$ isUserAgentListGoing ) {
376
+ if (! $ isUserAgentListGoing ) {
374
377
$ isUserAgentListGoing = true ;
375
378
$ currentUserAgents = [];
376
379
}
0 commit comments