original_string: private function sendErrorDocument(
          ResponseInterface $response): ResponseInterface
          {
          if ($this->errorDocument && preg_match(
                  "/^(4|5){1}[0-2]{1}[0-9]{1}$/", $response->getStatusCode())
              ) {
              $this->errorDocument = str_replace(
                  "{status}", $response->getStatusCode(), $this->errorDocument
              );
              if ($this->errorDocument !== filter_input(INPUT_SERVER, "REQUEST_URI")) {
                  $response = $response->withHeader(
                      Response::HEADER_REFRESH,
                      "0; " . $this->errorDocument
                  );
              }
          }
          return $response;
      }
code: private function sendErrorDocument(
          ResponseInterface $response): ResponseInterface
          {
          if ($this->errorDocument && preg_match(
                  "/^(4|5){1}[0-2]{1}[0-9]{1}$/", $response->getStatusCode())
              ) {
              $this->errorDocument = str_replace(
                  "{status}", $response->getStatusCode(), $this->errorDocument
              );
              if ($this->errorDocument !== filter_input(INPUT_SERVER, "REQUEST_URI")) {
                  $response = $response->withHeader(
                      Response::HEADER_REFRESH,
                      "0; " . $this->errorDocument
                  );
              }
          }
          return $response;
      }
code_tokens: private function sendErrorDocument ( ResponseInterface $ response ) : ResponseInterface { if ( $ this -> errorDocument && preg_match ( "/^(4|5){1}[0-2]{1}[0-9]{1}$/" , $ response -> getStatusCode ( ) ) ) { $ this -> errorDocument = str_replace ( "{status}" , $ response -> getStatusCode ( ) , $ this -> errorDocument ) ; if ( $ this -> errorDocument !== filter_input ( INPUT_SERVER , "REQUEST_URI" ) ) { $ response = $ response -> withHeader ( Response :: HEADER_REFRESH , "0; " . $ this -> errorDocument ) ; } } return $ response ; }
docstring: Send error document
  
  @param ResponseInterface $response psr-7 response
  @return ResponseInterface psr-7 response
docstring_tokens: Send error document