protected function getStatusCode(View $view, $content = null)
    {
        $form = $this->getFormFromView($view);

        if ($form && $form->isSubmitted() && !$form->isValid()) {
            return $this->failedValidationCode;
        }

        $statusCode = $view->getStatusCode();
        if (null !== $statusCode) {
            return $statusCode;
        }

        return null !== $content ? Response::HTTP_OK : $this->emptyContentCode;
    }
protected function getStatusCode(View $view, $content = null)
    {
        $form = $this->getFormFromView($view);

        if ($form && $form->isSubmitted() && !$form->isValid()) {
            return $this->failedValidationCode;
        }

        $statusCode = $view->getStatusCode();
        if (null !== $statusCode) {
            return $statusCode;
        }

        return null !== $content ? Response::HTTP_OK : $this->emptyContentCode;
    }
protected function getStatusCode ( View $ view , $ content = null ) { $ form = $ this -> getFormFromView ( $ view ) ; if ( $ form && $ form -> isSubmitted ( ) && ! $ form -> isValid ( ) ) { return $ this -> failedValidationCode ; } $ statusCode = $ view -> getStatusCode ( ) ; if ( null !== $ statusCode ) { return $ statusCode ; } return null !== $ content ? Response :: HTTP_OK : $ this -> emptyContentCode ; }
Gets a response HTTP status code from a View instance.

By default it will return 200. However if there is a FormInterface stored for
the key 'form' in the View's data it will return the failed_validation
configuration if the form instance has errors.

@param View  $view
@param mixed $content

@return int HTTP status code
Gets a response HTTP status code from a View instance .