public function priorityFor(string $mimeType): float
    {
        if (!isset($this->acceptables[$mimeType])) {
            if ($this->count() === 0) {
                return 1.0;
            } elseif (isset($this->acceptables['*/*'])) {
                return $this->acceptables['*/*'];
            }

            list($maintype) = explode('/', $mimeType);
            return $this->acceptables[$maintype . '/*'] ?? 0;
        }

        return $this->acceptables[$mimeType];
    }
public function priorityFor(string $mimeType): float
    {
        if (!isset($this->acceptables[$mimeType])) {
            if ($this->count() === 0) {
                return 1.0;
            } elseif (isset($this->acceptables['*/*'])) {
                return $this->acceptables['*/*'];
            }

            list($maintype) = explode('/', $mimeType);
            return $this->acceptables[$maintype . '/*'] ?? 0;
        }

        return $this->acceptables[$mimeType];
    }
public function priorityFor ( string $ mimeType ) : float { if ( ! isset ( $ this -> acceptables [ $ mimeType ] ) ) { if ( $ this -> count ( ) === 0 ) { return 1.0 ; } elseif ( isset ( $ this -> acceptables [ '*/*' ] ) ) { return $ this -> acceptables [ '*/*' ] ; } list ( $ maintype ) = explode ( '/' , $ mimeType ) ; return $ this -> acceptables [ $ maintype . '/*' ] ?? 0 ; } return $ this -> acceptables [ $ mimeType ] ; }
returns priority for given acceptable

If returned priority is 0 the requested acceptable is not in the list. In
case no acceptables were added before every requested acceptable has a
priority of 1.0.

@param   string  $mimeType
@return  float
returns priority for given acceptable