private function getMatchesFromAcceptedLanguages()
    {
        $matches = [];

        $acceptLanguages = $this->request->header('Accept-Language');

        if ( ! empty($acceptLanguages)) {
            $acceptLanguages = explode(',', $acceptLanguages);

            $genericMatches = $this->retrieveGenericMatches($acceptLanguages, $matches);

            $matches = array_merge($genericMatches, $matches);
            arsort($matches, SORT_NUMERIC);
        }

        return $matches;
    }
private function getMatchesFromAcceptedLanguages()
    {
        $matches = [];

        $acceptLanguages = $this->request->header('Accept-Language');

        if ( ! empty($acceptLanguages)) {
            $acceptLanguages = explode(',', $acceptLanguages);

            $genericMatches = $this->retrieveGenericMatches($acceptLanguages, $matches);

            $matches = array_merge($genericMatches, $matches);
            arsort($matches, SORT_NUMERIC);
        }

        return $matches;
    }
private function getMatchesFromAcceptedLanguages ( ) { $ matches = [ ] ; $ acceptLanguages = $ this -> request -> header ( 'Accept-Language' ) ; if ( ! empty ( $ acceptLanguages ) ) { $ acceptLanguages = explode ( ',' , $ acceptLanguages ) ; $ genericMatches = $ this -> retrieveGenericMatches ( $ acceptLanguages , $ matches ) ; $ matches = array_merge ( $ genericMatches , $ matches ) ; arsort ( $ matches , SORT_NUMERIC ) ; } return $ matches ; }
Return all the accepted languages from the browser

@return array  -  Matches from the header field Accept-Languages
Return all the accepted languages from the browser