code: private function resolveDependencies(callable $callback, array $vars): array
      {
          $method = new \ReflectionMethod($callback[0], $callback[1]);
  
          $dependencies = [];
  
          foreach ($method->getParameters() as $parameter) {
              if ($parameter->getClass() === null && !count($vars)) {
                  break;
              }
  
              if ($parameter->getClass() === null && count($vars)) {
                  $dependencies[] = array_shift($vars);
  
                  continue;
              }
  
              $dependencies[] = $this->injector->make($parameter->getClass()->name);
          }
  
          return $dependencies;
      }
docs: Resolves dependencies for a callback
  
  @param callable $callback The callback to execute
  @param array    $vars     The variables to inject for string arguments (URL path variables)
  
  @return array List of resolved dependencies