Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[OptionsResolver] wrong exception hierarchy #10585

Copy link
Copy link
Closed
@Tobion

Description

@Tobion
Issue body actions

I think the exceptions are defined wrong because they don't respect the meaning of runtime vs logic exception.

  • OptionDefinitionException is obviously a logic exception because it happens with a code problem and should extend \BadMethodCallException
  • InvalidOptionsException (as thrown by resolve()) is a runtimeexception and should extend \UnexpectedValueException
  • MissingOptionsException is also runtimeexception and should extend \UnexpectedValueException
  • setAllowedValues() and similar run validateOptionsExistence() and also throw a InvalidOptionsException. Instead it should be a OptionDefinitionException because its a code problem when defining options and not a runtime exception.
  • OptionsResolverInterface::setNormalizers is missing an @throws

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.