protected function setRouteProperties(Route $route): void
    {
        if (null === $route->getProperty()) {
            $methodReflection = $this->getMethodReflection(
                $route->getClass(),
                $route->getMethod() ?? '__construct'
            );

            // Set the dependencies
            $route->setDependencies(
                $this->getDependencies(...$methodReflection->getParameters())
            );
        }

        // Avoid having large arrays in cached routes file
        $route->setMatches();

        if (null === $route->getPath()) {
            throw new InvalidRoutePath(
                'Invalid route name for route : '
                . $route->getClass()
                . '@' . $route->getMethod()
            );
        }
    }