original_string: public function generateToken(ServerRequest $request)
      {
          if ($request->is('requested')) {
              if ($this->session->check('_Token')) {
                  $request = $request->withParam('_Token', $this->session->read('_Token'));
              }
  
              return $request;
          }
          $token = [
              'allowedControllers' => $this->_config['allowedControllers'],
              'allowedActions' => $this->_config['allowedActions'],
              'unlockedFields' => $this->_config['unlockedFields'],
          ];
  
          $this->session->write('_Token', $token);
  
          return $request->withParam('_Token', [
              'unlockedFields' => $token['unlockedFields']
          ]);
      }
code: public function generateToken(ServerRequest $request)
      {
          if ($request->is('requested')) {
              if ($this->session->check('_Token')) {
                  $request = $request->withParam('_Token', $this->session->read('_Token'));
              }
  
              return $request;
          }
          $token = [
              'allowedControllers' => $this->_config['allowedControllers'],
              'allowedActions' => $this->_config['allowedActions'],
              'unlockedFields' => $this->_config['unlockedFields'],
          ];
  
          $this->session->write('_Token', $token);
  
          return $request->withParam('_Token', [
              'unlockedFields' => $token['unlockedFields']
          ]);
      }
code_tokens: public function generateToken ( ServerRequest $ request ) { if ( $ request -> is ( 'requested' ) ) { if ( $ this -> session -> check ( '_Token' ) ) { $ request = $ request -> withParam ( '_Token' , $ this -> session -> read ( '_Token' ) ) ; } return $ request ; } $ token = [ 'allowedControllers' => $ this -> _config [ 'allowedControllers' ] , 'allowedActions' => $ this -> _config [ 'allowedActions' ] , 'unlockedFields' => $ this -> _config [ 'unlockedFields' ] , ] ; $ this -> session -> write ( '_Token' , $ token ) ; return $ request -> withParam ( '_Token' , [ 'unlockedFields' => $ token [ 'unlockedFields' ] ] ) ; }
docstring: Manually add form tampering prevention token information into the provided
  request object.
  
  @param \Cake\Http\ServerRequest $request The request object to add into.
  @return \Cake\Http\ServerRequest The modified request.
docstring_tokens: Manually add form tampering prevention token information into the provided request object .