src/Resources/Resource.php
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);
  }
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);
  }
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 ) ; }
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
Helper function for resolving parameters .