ZF\Apigility\Admin\Controller\AbstractAuthenticationController::getVersion PHP Method

getVersion() protected method

Get the API version from the Accept header
protected getVersion ( Zend\Http\Request $request ) : integer
$request Zend\Http\Request
return integer
    protected function getVersion(Request $request)
    {
        $accept = $request->getHeader('Accept', false);
        if (!$accept) {
            return 1;
        }
        if (preg_match('/application\\/vnd\\.apigility\\.v(\\d+)\\+json/', $accept->getFieldValue(), $matches)) {
            return (int) $matches[1];
        }
        return 1;
    }
AbstractAuthenticationController