src/Crawler/UserEventCrawler.php
public function getYearCount(string $username, ?int $year, int $page = 1): int
    {
        $node = $this->crawlUrl($username, $year, $page);

        if (null === $node) {
            return 0;
        }

        $perPage = $this->countListEvents($node);
        $pages   = $this->countListPages($node);

        if ($pages) {
            $node = $this->crawlUrl($username, $year, $pages);

            if (null === $node) {
                return $perPage;
            }

            $count = $this->countListEvents($node);

            return ($pages - 1) * $perPage + $count;
        }

        return $perPage;
    }
public function getYearCount(string $username, ?int $year, int $page = 1): int
    {
        $node = $this->crawlUrl($username, $year, $page);

        if (null === $node) {
            return 0;
        }

        $perPage = $this->countListEvents($node);
        $pages   = $this->countListPages($node);

        if ($pages) {
            $node = $this->crawlUrl($username, $year, $pages);

            if (null === $node) {
                return $perPage;
            }

            $count = $this->countListEvents($node);

            return ($pages - 1) * $perPage + $count;
        }

        return $perPage;
    }
{@inheritdoc}