protected function checkCompletedAchievements($owner): int
    {
        $achievements = $this->storage->getAchievementsWithProgressFor($owner, $this->achievementsToCheck);
        $this->achievementsToCheck = [];

        if (!$achievements || !count($achievements)) {
            return 0;
        }

        $completedAchievements = array_filter($achievements, function (Achievement $achievement) {
            return !$achievement->completed() && $this->isCompletedAchievement($achievement);
        });

        if (count($completedAchievements) > 0) {
            $this->storage->setAchievementsCompleted($owner, $completedAchievements);
        }

        return count($completedAchievements);
    }