private function filterParameters(string $parameters, bool &$is_binary_data): array
    {
        if ('' === $parameters) {
            return [static::DEFAULT_PARAMETER];
        }

        if (1 === preg_match(',(;|^)'.static::BINARY_PARAMETER.'$,', $parameters, $matches)) {
            $parameters = substr($parameters, 0, - strlen($matches[0]));
            $is_binary_data = true;
        }

        $params = array_filter(explode(';', $parameters));
        if ([] !== array_filter($params, [$this, 'validateParameter'])) {
            throw new SyntaxError(sprintf('invalid mediatype parameters, `%s`', $parameters));
        }

        return $params;
    }
private function filterParameters(string $parameters, bool &$is_binary_data): array
    {
        if ('' === $parameters) {
            return [static::DEFAULT_PARAMETER];
        }

        if (1 === preg_match(',(;|^)'.static::BINARY_PARAMETER.'$,', $parameters, $matches)) {
            $parameters = substr($parameters, 0, - strlen($matches[0]));
            $is_binary_data = true;
        }

        $params = array_filter(explode(';', $parameters));
        if ([] !== array_filter($params, [$this, 'validateParameter'])) {
            throw new SyntaxError(sprintf('invalid mediatype parameters, `%s`', $parameters));
        }

        return $params;
    }
private function filterParameters ( string $ parameters , bool & $ is_binary_data ) : array { if ( '' === $ parameters ) { return [ static :: DEFAULT_PARAMETER ] ; } if ( 1 === preg_match ( ',(;|^)' . static :: BINARY_PARAMETER . '$,' , $ parameters , $ matches ) ) { $ parameters = substr ( $ parameters , 0 , - strlen ( $ matches [ 0 ] ) ) ; $ is_binary_data = true ; } $ params = array_filter ( explode ( ';' , $ parameters ) ) ; if ( [ ] !== array_filter ( $ params , [ $ this , 'validateParameter' ] ) ) { throw new SyntaxError ( sprintf ( 'invalid mediatype parameters, `%s`' , $ parameters ) ) ; } return $ params ; }
Extract and set the binary flag from the parameters if it exists.

@param bool $is_binary_data the binary flag to set

@throws SyntaxError If the mediatype parameters contain invalid data

@return string[]
Extract and set the binary flag from the parameters if it exists .