ZF\Apigility\Admin\Controller\AuthenticationTypeController::authTypeAction PHP Метод

authTypeAction() публичный Метод

Get the authentication type list Since Apigility 1.1
public authTypeAction ( )
    public function authTypeAction()
    {
        $request = $this->getRequest();
        $version = $this->getVersion($request);
        switch ($version) {
            case 1:
                return new ApiProblemResponse(new ApiProblem(406, 'This API is supported starting from version 2'));
            case 2:
                if ($request->getMethod() !== $request::METHOD_GET) {
                    $response = new ApiProblemResponse(new ApiProblem(405, 'Only the method GET is allowed for this URI'));
                    $response->getHeaders()->addHeaderLine('Allow', 'GET');
                    return $response;
                }
                return $this->createAdapterCollection();
            default:
                return new ApiProblemResponse(new ApiProblem(406, 'The API version specified is not supported'));
        }
    }