original_string: public function resolveOptions($options, $defaults, $required = [], $allowedTypes = [])
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults($defaults);
  
        if (!empty($required)) {
            $resolver->setRequired($required);
        }
  
        if (!empty($allowedTypes)) {
            foreach ($allowedTypes as $type => $value) {
                $resolver->setAllowedValues($type, $value);
            }
        }
  
        return $resolver->resolve($options);
    }
code: public function resolveOptions($options, $defaults, $required = [], $allowedTypes = [])
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults($defaults);
  
        if (!empty($required)) {
            $resolver->setRequired($required);
        }
  
        if (!empty($allowedTypes)) {
            foreach ($allowedTypes as $type => $value) {
                $resolver->setAllowedValues($type, $value);
            }
        }
  
        return $resolver->resolve($options);
    }
code_tokens: public function resolveOptions ( $ options , $ defaults , $ required = [ ] , $ allowedTypes = [ ] ) { $ resolver = new OptionsResolver ( ) ; $ resolver -> setDefaults ( $ defaults ) ; if ( ! empty ( $ required ) ) { $ resolver -> setRequired ( $ required ) ; } if ( ! empty ( $ allowedTypes ) ) { foreach ( $ allowedTypes as $ type => $ value ) { $ resolver -> setAllowedValues ( $ type , $ value ) ; } } return $ resolver -> resolve ( $ options ) ; }
docstring: Helper function for resolving parameters.
  
  @param  array $options      Passed params
  @param  array $defaults     Default values
  @param  array $required     Required fields
  @param  array $allowedTypes Allowed field values
  
  @return array
docstring_tokens: Helper function for resolving parameters .