Skip to content

Commit ef92654

Browse files
freekmurzegithub-actions[bot]
authored andcommitted
Fix styling
1 parent 47bdc8a commit ef92654

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/RobotsTxt.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ public function allows(string $url, ?string $userAgent = '*'): bool
124124
return ! $isDenied;
125125
}
126126

127-
public function crawlDelay(string $userAgent = '*'): ?string {
127+
public function crawlDelay(string $userAgent = '*'): ?string
128+
{
128129
$crawlDelaysPerUserAgent = $this->includeGlobalGroup
129130
? $this->crawlDelaysPerUserAgent
130131
: array_filter($this->crawlDelaysPerUserAgent, fn ($key) => $key !== '*', ARRAY_FILTER_USE_KEY);
@@ -133,9 +134,10 @@ public function crawlDelay(string $userAgent = '*'): ?string {
133134

134135
if (isset($crawlDelaysPerUserAgent[$normalizedUserAgent])) {
135136
return $crawlDelaysPerUserAgent[$normalizedUserAgent];
136-
} else if (isset($crawlDelaysPerUserAgent['*'])) {
137+
} elseif (isset($crawlDelaysPerUserAgent['*'])) {
137138
return $crawlDelaysPerUserAgent['*'];
138139
}
140+
139141
return null;
140142
}
141143

@@ -350,7 +352,8 @@ protected function getAllowsPerUserAgent(string $content): array
350352
return $allowsPerUserAgent;
351353
}
352354

353-
protected function getCrawlDelaysPerUserAgent(string $content): array {
355+
protected function getCrawlDelaysPerUserAgent(string $content): array
356+
{
354357
$lines = explode(PHP_EOL, $content);
355358

356359
$lines = array_filter($lines);
@@ -370,7 +373,7 @@ protected function getCrawlDelaysPerUserAgent(string $content): array {
370373
}
371374

372375
if ($this->isUserAgentLine($line)) {
373-
if (!$isUserAgentListGoing) {
376+
if (! $isUserAgentListGoing) {
374377
$isUserAgentListGoing = true;
375378
$currentUserAgents = [];
376379
}

tests/RobotsTxtTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,5 +323,4 @@ public function it_has_null_crawl_delay_for_default_user_agent_if_it_is_not_defi
323323
');
324324
$this->assertNull($robots->crawlDelay('*'));
325325
}
326-
327326
}

0 commit comments

Comments
 (0)