Skip to content

Commit

Permalink
fix likely part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
fiste788 committed Nov 21, 2024
1 parent 78edfd9 commit 8646f0c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Service/LikelyLineupService.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private function processMatch(Crawler $match): void
return $v;
}, $match->filter('.details-team')->extract(['_text']));
$regulars = $match->filter('.lineup-team__lineup-list');
$details = $match->filter('.details-team');
$details = $match->filter('.match-details__note-row');
foreach ($teamsName as $team) {
$this->_teams[$team]['regulars'] = $regulars->eq($i);
$this->_teams[$team]['details'] = $details->eq($i);
Expand All @@ -128,14 +128,10 @@ private function processMember(Member &$member): void
$member->likely_lineup->versus = $this->_versus[$club];
$member->likely_lineup->regular = null;
try {
$find = $divs['regulars']->filter('li:contains("' . strtoupper($member->player->surname) . '")');
if ($find->count() > 0) {
if ($divs['regulars']->filter('li:contains("' . $member->player->surname . '")')->count() > 0) {
$member->likely_lineup->regular = true;
}
$find = $divs['details']->filter('p:contains("' . strtoupper($member->player->surname) . '")');
if ($find->count() == 0) {
$find = $divs['details']->filter('p:contains("' . $member->player->surname . '")');
}
$find = $divs['details']->filter('p:contains("' . $member->player->surname . '")');
} catch (RuntimeException | LogicException $e) {
$find = null;
}
Expand Down

0 comments on commit 8646f0c

Please sign in to comment.