protected function validateRedirect()
    {
        if (!$this instanceof RedirectResponseInterface || !$this->isRedirect()) {
            throw new RuntimeException('This response does not support redirection.');
        }

        if (empty($this->getRedirectUrl())) {
            throw new RuntimeException('The given redirectUrl cannot be empty.');
        }

        if (!in_array($this->getRedirectMethod(), ['GET', 'POST'])) {
            throw new RuntimeException('Invalid redirect method "'.$this->getRedirectMethod().'".');
        }
    }
protected function validateRedirect()
    {
        if (!$this instanceof RedirectResponseInterface || !$this->isRedirect()) {
            throw new RuntimeException('This response does not support redirection.');
        }

        if (empty($this->getRedirectUrl())) {
            throw new RuntimeException('The given redirectUrl cannot be empty.');
        }

        if (!in_array($this->getRedirectMethod(), ['GET', 'POST'])) {
            throw new RuntimeException('Invalid redirect method "'.$this->getRedirectMethod().'".');
        }
    }
protected function validateRedirect ( ) { if ( ! $ this instanceof RedirectResponseInterface || ! $ this -> isRedirect ( ) ) { throw new RuntimeException ( 'This response does not support redirection.' ) ; } if ( empty ( $ this -> getRedirectUrl ( ) ) ) { throw new RuntimeException ( 'The given redirectUrl cannot be empty.' ) ; } if ( ! in_array ( $ this -> getRedirectMethod ( ) , [ 'GET' , 'POST' ] ) ) { throw new RuntimeException ( 'Invalid redirect method "' . $ this -> getRedirectMethod ( ) . '".' ) ; } }
Validate that the current Response is a valid redirect.

@return void
Validate that the current Response is a valid redirect .