2

I am using the optionsResolver component of symfony

I have the following code:

public function test($group, array $options = [])
{
    $this->resolver->setDefaults([
        'query' => ['group' => $group],
        'form_params' => ['user' => 'test_user'],
    ]);
    $this->resolver->setDefined('connect_timeout');
    $options = $this->resolver->resolve($options);
}

What I would like to do is if someone calls test function to throw an exception if he passes the option with key query but to allow him to pass the option connect_timeout or form_params.

Is this possible?

gmponos
  • 2,157
  • 4
  • 22
  • 33

0 Answers0