Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mirko-pagliai committed Jan 4, 2024
1 parent cd00e57 commit 21cb7f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
autoloader="tests/bootstrap.php"
errorBaseline="psalm-baseline.neon"
findUnusedCode="false"
findUnusedBaselineEntry="true"
>
<projectFiles>
<directory name="src" />
Expand Down
3 changes: 2 additions & 1 deletion src/Utility/BodyParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function extractLinks(): array

$crawler = new Crawler($this->body);

$links = [];
foreach (self::TAGS as $tag => $attribute) {
foreach ($crawler->filterXPath('//' . $tag)->extract([$attribute]) as $link) {
if ($link) {
Expand All @@ -98,6 +99,6 @@ public function extractLinks(): array
}
}

return $this->extractedLinks = array_unique($links ?? []);
return $this->extractedLinks = array_unique($links);
}
}

0 comments on commit 21cb7f5

Please sign in to comment.