Enums allow a developer to define a custom type that is limited to one of a discrete number of possible values. Using it as an array key was not that straightforward.
Sometimes there are cryptic error messages in Drupal, and it's hard to understand what exactly is wrong. I had an issue with custom access in one of the routes throwing BadMethodCallException.