original_string: protected function _processPost($data)
      {
          $method = $this->getEnv('REQUEST_METHOD');
          $override = false;
  
          if (in_array($method, ['PUT', 'DELETE', 'PATCH']) &&
              strpos($this->contentType(), 'application/x-www-form-urlencoded') === 0
          ) {
              $data = $this->input();
              parse_str($data, $data);
          }
          if ($this->hasHeader('X-Http-Method-Override')) {
              $data['_method'] = $this->getHeaderLine('X-Http-Method-Override');
              $override = true;
          }
          $this->_environment['ORIGINAL_REQUEST_METHOD'] = $method;
          if (isset($data['_method'])) {
              $this->_environment['REQUEST_METHOD'] = $data['_method'];
              unset($data['_method']);
              $override = true;
          }
  
          if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'])) {
              $data = [];
          }
  
          return $data;
      }
code: protected function _processPost($data)
      {
          $method = $this->getEnv('REQUEST_METHOD');
          $override = false;
  
          if (in_array($method, ['PUT', 'DELETE', 'PATCH']) &&
              strpos($this->contentType(), 'application/x-www-form-urlencoded') === 0
          ) {
              $data = $this->input();
              parse_str($data, $data);
          }
          if ($this->hasHeader('X-Http-Method-Override')) {
              $data['_method'] = $this->getHeaderLine('X-Http-Method-Override');
              $override = true;
          }
          $this->_environment['ORIGINAL_REQUEST_METHOD'] = $method;
          if (isset($data['_method'])) {
              $this->_environment['REQUEST_METHOD'] = $data['_method'];
              unset($data['_method']);
              $override = true;
          }
  
          if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'])) {
              $data = [];
          }
  
          return $data;
      }
code_tokens: protected function _processPost ( $ data ) { $ method = $ this -> getEnv ( 'REQUEST_METHOD' ) ; $ override = false ; if ( in_array ( $ method , [ 'PUT' , 'DELETE' , 'PATCH' ] ) && strpos ( $ this -> contentType ( ) , 'application/x-www-form-urlencoded' ) === 0 ) { $ data = $ this -> input ( ) ; parse_str ( $ data , $ data ) ; } if ( $ this -> hasHeader ( 'X-Http-Method-Override' ) ) { $ data [ '_method' ] = $ this -> getHeaderLine ( 'X-Http-Method-Override' ) ; $ override = true ; } $ this -> _environment [ 'ORIGINAL_REQUEST_METHOD' ] = $ method ; if ( isset ( $ data [ '_method' ] ) ) { $ this -> _environment [ 'REQUEST_METHOD' ] = $ data [ '_method' ] ; unset ( $ data [ '_method' ] ) ; $ override = true ; } if ( $ override && ! in_array ( $ this -> _environment [ 'REQUEST_METHOD' ] , [ 'PUT' , 'POST' , 'DELETE' , 'PATCH' ] ) ) { $ data = [ ] ; } return $ data ; }
docstring: Sets the REQUEST_METHOD environment variable based on the simulated _method
  HTTP override value. The 'ORIGINAL_REQUEST_METHOD' is also preserved, if you
  want the read the non-simulated HTTP method the client used.
  
  @param array $data Array of post data.
  @return array
docstring_tokens: Sets the REQUEST_METHOD environment variable based on the simulated _method HTTP override value . The ORIGINAL_REQUEST_METHOD is also preserved if you want the read the non - simulated HTTP method the client used .