src/AchievementChain.php
public function highestOnChain($achiever)
    {
        $latestUnlocked = null;
        foreach($this->chain() as $instance) {
            /** @var Achievement $instance */
            /** @var Achiever $achiever */
            if($achiever->hasUnlocked($instance)){
                $latestUnlocked = $achiever->achievementStatus($instance);
            } else {
                return $latestUnlocked;
            }
        }
        return $latestUnlocked;
    }
public function highestOnChain($achiever)
    {
        $latestUnlocked = null;
        foreach($this->chain() as $instance) {
            /** @var Achievement $instance */
            /** @var Achiever $achiever */
            if($achiever->hasUnlocked($instance)){
                $latestUnlocked = $achiever->achievementStatus($instance);
            } else {
                return $latestUnlocked;
            }
        }
        return $latestUnlocked;
    }
public function highestOnChain ( $ achiever ) { $ latestUnlocked = null ; foreach ( $ this -> chain ( ) as $ instance ) { /** @var Achievement $instance */ /** @var Achiever $achiever */ if ( $ achiever -> hasUnlocked ( $ instance ) ) { $ latestUnlocked = $ achiever -> achievementStatus ( $ instance ) ; } else { return $ latestUnlocked ; } } return $ latestUnlocked ; }
For an Achiever, return the highest achievement on the chain that is unlocked.
@param $achiever
@return null|AchievementProgress
For an Achiever return the highest achievement on the chain that is unlocked .