Skip to content

Commit

Permalink
Fix status parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
N0D4N committed Apr 11, 2021
1 parent 48915ef commit 4e5c11a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Parser/User/Profile/LastUpdatesParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LastUpdatesParser
/**
* @var Crawler
*/
private $crawler;
private Crawler $crawler;

/**
* LastUpdates constructor.
Expand All @@ -41,7 +41,7 @@ public function getModel(): LastUpdates
public function getLastAnimeUpdates(): array
{
$arr = $this->parseBaseListUpdates('anime');
$results = array();
$results = [];
/**
* @var $baseLastUpdate BaseLastUpdate
*/
Expand All @@ -58,7 +58,7 @@ public function getLastAnimeUpdates(): array
public function getLastMangaUpdates(): array
{
$arr = $this->parseBaseListUpdates('manga');
$results = array();
$results = [];
/**
* @var $baseLastUpdate BaseLastUpdate
*/
Expand Down Expand Up @@ -88,7 +88,6 @@ private function parseBaseListUpdates(string $updateType): array
/** @var $progressed int|null */
$progressed = null;

$status = "";
$progressedTotalSeparatorIndex = strpos($progressTypeValueUnparsed, '/');
if ($progressedTotalSeparatorIndex != false) {
$totalUnparsed = substr($progressTypeValueUnparsed, $progressedTotalSeparatorIndex + 1);
Expand All @@ -97,9 +96,10 @@ private function parseBaseListUpdates(string $updateType): array
$progressed = ctype_digit($progressedUnparsed) ? intval($progressedUnparsed) : null;
$status = trim(substr($progressTypeValueUnparsed, 0, $progressedTotalSeparatorIndex - 2));
} else {
$progressTypeValueUnparsed = str_replace(" -", "", $progressTypeValueUnparsed);
$status = trim($progressTypeValueUnparsed);
}
return new BaseLastUpdate($url, $title, $imageUrl, $progressed, $total, $status, $score, $date);
});
}
}
}

0 comments on commit 4e5c11a

Please sign in to comment.