$controller can be one of three types but based on the type you can infer what the
controller actually is:
- string (controller is a named function)
- array (controller is a class method [0 => ClassName, 1 => MethodName])
- \Closure (controller is an anonymous function)