original_string: public function required($keys, array $params = [], array $parents = [])
      {
          if (!$params) {
              $params = $this->all();
          }
          
          if (is_array($keys)) {
              foreach ($keys as $key => $value) {
                  if (is_int($key)) {
                      $key = $value;
                  }
                  
                  if (!isset($params[$key])) {
                      if ($parents) {
                          $str = '';
                          foreach ($parents as $parent) {
                              $str .= '[ ' . $parent . ' => ';
                          }
                          $str .= $key . str_repeat(' ]', count($parents));
                      } else {
                          $str = $Key;
                      }
                      throw new ParameterMissingException(sprintf(
                          "Missing parameter %s",
                          $str
                      ));
                  }
                  
                  if (is_array($value)) {
                      $params = $params[$key];
                      $parents[] = $key;
                      $this->required($value, $params, $parents);
                  }
              }
          } else {
              if (!isset($params[$keys])) {
                  throw new ParameterMissingException(sprintf(
                      "Missing parameter %s",
                      $keys
                  ));
              }
          }
      }
code: public function required($keys, array $params = [], array $parents = [])
      {
          if (!$params) {
              $params = $this->all();
          }
          
          if (is_array($keys)) {
              foreach ($keys as $key => $value) {
                  if (is_int($key)) {
                      $key = $value;
                  }
                  
                  if (!isset($params[$key])) {
                      if ($parents) {
                          $str = '';
                          foreach ($parents as $parent) {
                              $str .= '[ ' . $parent . ' => ';
                          }
                          $str .= $key . str_repeat(' ]', count($parents));
                      } else {
                          $str = $Key;
                      }
                      throw new ParameterMissingException(sprintf(
                          "Missing parameter %s",
                          $str
                      ));
                  }
                  
                  if (is_array($value)) {
                      $params = $params[$key];
                      $parents[] = $key;
                      $this->required($value, $params, $parents);
                  }
              }
          } else {
              if (!isset($params[$keys])) {
                  throw new ParameterMissingException(sprintf(
                      "Missing parameter %s",
                      $keys
                  ));
              }
          }
      }
code_tokens: public function required ( $ keys , array $ params = [ ] , array $ parents = [ ] ) { if ( ! $ params ) { $ params = $ this -> all ( ) ; } if ( is_array ( $ keys ) ) { foreach ( $ keys as $ key => $ value ) { if ( is_int ( $ key ) ) { $ key = $ value ; } if ( ! isset ( $ params [ $ key ] ) ) { if ( $ parents ) { $ str = '' ; foreach ( $ parents as $ parent ) { $ str .= '[ ' . $ parent . ' => ' ; } $ str .= $ key . str_repeat ( ' ]' , count ( $ parents ) ) ; } else { $ str = $ Key ; } throw new ParameterMissingException ( sprintf ( "Missing parameter %s" , $ str ) ) ; } if ( is_array ( $ value ) ) { $ params = $ params [ $ key ] ; $ parents [ ] = $ key ; $ this -> required ( $ value , $ params , $ parents ) ; } } } else { if ( ! isset ( $ params [ $ keys ] ) ) { throw new ParameterMissingException ( sprintf ( "Missing parameter %s" , $ keys ) ) ; } } }
docstring: Checks for required parameters. If one of them is null,
  ParameterMissingException is thrown.
  
  ```
  // Check for a value.
  $parameters->required('user');
  
  // Check for an array and some keys
  $parameters->required(['user' => ['name', 'address']]);
  ```
  
  @throws ParameterMissingException
docstring_tokens: Checks for required parameters . If one of them is null ParameterMissingException is thrown .