public function accepts($contentTypes)
    {
        $accepts = $this->getAcceptableContentTypes();

        if (count($accepts) === 0) {
            return true;
        }

        $types = (array) $contentTypes;

        foreach ($accepts as $accept) {
            if ($accept === '*/*' || $accept === '*') {
                return true;
            }

            foreach ($types as $type) {
                if ($this->matchesType($accept, $type) || $accept === strtok($type, '/').'/*') {
                    return true;
                }
            }
        }

        return false;
    }
public function accepts($contentTypes)
    {
        $accepts = $this->getAcceptableContentTypes();

        if (count($accepts) === 0) {
            return true;
        }

        $types = (array) $contentTypes;

        foreach ($accepts as $accept) {
            if ($accept === '*/*' || $accept === '*') {
                return true;
            }

            foreach ($types as $type) {
                if ($this->matchesType($accept, $type) || $accept === strtok($type, '/').'/*') {
                    return true;
                }
            }
        }

        return false;
    }
public function accepts ( $ contentTypes ) { $ accepts = $ this -> getAcceptableContentTypes ( ) ; if ( count ( $ accepts ) === 0 ) { return true ; } $ types = ( array ) $ contentTypes ; foreach ( $ accepts as $ accept ) { if ( $ accept === '*/*' || $ accept === '*' ) { return true ; } foreach ( $ types as $ type ) { if ( $ this -> matchesType ( $ accept , $ type ) || $ accept === strtok ( $ type , '/' ) . '/*' ) { return true ; } } } return false ; }
Determines whether the current requests accepts a given content type.

@param  string|array  $contentTypes
@return bool
Determines whether the current requests accepts a given content type .