code: private function compareAcceptLanguageHeaders(AcceptLanguageHeaderValue $a, AcceptLanguageHeaderValue $b): int
      {
          $aQuality = $a->getQuality();
          $bQuality = $b->getQuality();
  
          if ($aQuality < $bQuality) {
              return 1;
          }
  
          if ($aQuality > $bQuality) {
              return -1;
          }
  
          $aValue = $a->getLanguage();
          $bValue = $b->getLanguage();
  
          if ($aValue === '*') {
              if ($bValue === '*') {
                  return 0;
              }
  
              return 1;
          }
  
          if ($bValue === '*') {
              return -1;
          }
  
          return 0;
      }
docs: Compares two languages and returns which of them is "lower" than the other
  
  @param AcceptLanguageHeaderValue $a The first language header to compare
  @param AcceptLanguageHeaderValue $b The second language header to compare
  @return int -1 if $a is lower than $b, 0 if they're even, or 1 if $a is higher than $b