public function higherQualityAlternative()
    {
        if ($this->alternatives) {
            $max = reset($this->alternatives);
            foreach($this->alternatives as $alternative)
            {
                if($alternative->quality() > $max->quality())
                {
                    $max = $alternative;
                }
            }

            return $max;
        }

        return $this;
    }
public function higherQualityAlternative()
    {
        if ($this->alternatives) {
            $max = reset($this->alternatives);
            foreach($this->alternatives as $alternative)
            {
                if($alternative->quality() > $max->quality())
                {
                    $max = $alternative;
                }
            }

            return $max;
        }

        return $this;
    }
public function higherQualityAlternative ( ) { if ( $ this -> alternatives ) { $ max = reset ( $ this -> alternatives ) ; foreach ( $ this -> alternatives as $ alternative ) { if ( $ alternative -> quality ( ) > $ max -> quality ( ) ) { $ max = $ alternative ; } } return $ max ; } return $ this ; }
Return the image higher quality version

@return ImageMedium the alternative version with higher quality
Return the image higher quality version