protected function isCompletedAchievement(Achievement $achievement): bool
    {
        $completedCriterias = array_filter($achievement->criterias(), function (AchievementCriteria $criteria) {
            return $this->isCompletedCriteria($criteria, $criteria->progress());
        });

        return count($achievement->criterias()) === count($completedCriterias);
    }
protected function isCompletedAchievement(Achievement $achievement): bool
    {
        $completedCriterias = array_filter($achievement->criterias(), function (AchievementCriteria $criteria) {
            return $this->isCompletedCriteria($criteria, $criteria->progress());
        });

        return count($achievement->criterias()) === count($completedCriterias);
    }
protected function isCompletedAchievement ( Achievement $ achievement ) : bool { $ completedCriterias = array_filter ( $ achievement -> criterias ( ) , function ( AchievementCriteria $ criteria ) { return $ this -> isCompletedCriteria ( $ criteria , $ criteria -> progress ( ) ) ; } ) ; return count ( $ achievement -> criterias ( ) ) === count ( $ completedCriterias ) ; }
Determines if given achievement was completed.

@param Achievement $achievement

@return bool
Determines if given achievement was completed .