Skip to content

Commit

Permalink
Merge pull request afup#1466 from Mopolo/phpstan-add-missing-node-type
Browse files Browse the repository at this point in the history
[PHPStan] Ajout d'une vérification de type d'un node
  • Loading branch information
stakovicz authored Mar 17, 2024
2 parents 7aae478 + 521a234 commit d144045
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sources/AppBundle/Indexation/Meetups/MeetupScraper.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function getEvents()
$events = $xpath->query("//*[contains(@id, 'event-card')]");
foreach ($events as $event) {
try {
if (!$event instanceof \DOMElement) {
throw new \Exception('Élement DOM de type invalide');
}

$eventUrl = $event->getAttribute('href');
if (preg_match('/\/(\d+)\/$/', $eventUrl, $matches)) {
$id = (int) $matches[1];
Expand Down

0 comments on commit d144045

Please sign in to comment.