original_string: protected function createLoginAttempt(array $data, array $headers, array $query)
      {
          // validate grant_type manually (needed to guess specialized option resolver)
          if (empty($data['grant_type'])) {
              throw new \InvalidArgumentException('Any grant_type given.');
          }
          $grantType = $data['grant_type'];
          if (!$this->grantExtensions->containsKey($grantType)) {
              throw new \InvalidArgumentException('Given grant_type is invalid.');
          }
  
          // create option resolver
          $requestResolver = new OptionsResolver();
          $requestResolver->setRequired(array(
              'client_secret',
              'client_api_key',
              'grant_type',
          ));
          $this->grantExtensions->get($grantType)
              ->configureRequestParameters($requestResolver)
          ;
  
          return new LoginAttempt(
              $query,
              $requestResolver->resolve($data),
              $headers
          );
      }
code: protected function createLoginAttempt(array $data, array $headers, array $query)
      {
          // validate grant_type manually (needed to guess specialized option resolver)
          if (empty($data['grant_type'])) {
              throw new \InvalidArgumentException('Any grant_type given.');
          }
          $grantType = $data['grant_type'];
          if (!$this->grantExtensions->containsKey($grantType)) {
              throw new \InvalidArgumentException('Given grant_type is invalid.');
          }
  
          // create option resolver
          $requestResolver = new OptionsResolver();
          $requestResolver->setRequired(array(
              'client_secret',
              'client_api_key',
              'grant_type',
          ));
          $this->grantExtensions->get($grantType)
              ->configureRequestParameters($requestResolver)
          ;
  
          return new LoginAttempt(
              $query,
              $requestResolver->resolve($data),
              $headers
          );
      }
code_tokens: protected function createLoginAttempt ( array $ data , array $ headers , array $ query ) { // validate grant_type manually (needed to guess specialized option resolver) if ( empty ( $ data [ 'grant_type' ] ) ) { throw new \ InvalidArgumentException ( 'Any grant_type given.' ) ; } $ grantType = $ data [ 'grant_type' ] ; if ( ! $ this -> grantExtensions -> containsKey ( $ grantType ) ) { throw new \ InvalidArgumentException ( 'Given grant_type is invalid.' ) ; } // create option resolver $ requestResolver = new OptionsResolver ( ) ; $ requestResolver -> setRequired ( array ( 'client_secret' , 'client_api_key' , 'grant_type' , ) ) ; $ this -> grantExtensions -> get ( $ grantType ) -> configureRequestParameters ( $ requestResolver ) ; return new LoginAttempt ( $ query , $ requestResolver -> resolve ( $ data ) , $ headers ) ; }
docstring: Validate given request parameters and build a
  LoginAttempt object with it.
  
  @param array $data
  @param array $headers
  @param array $query
  
  @return LoginAttempt
docstring_tokens: Validate given request parameters and build a LoginAttempt object with it .