diff --git a/src/TwigComponent/src/Command/TwigComponentDebugCommand.php b/src/TwigComponent/src/Command/TwigComponentDebugCommand.php index 4b43216acdf..68be2f29f2a 100644 --- a/src/TwigComponent/src/Command/TwigComponentDebugCommand.php +++ b/src/TwigComponent/src/Command/TwigComponentDebugCommand.php @@ -182,12 +182,12 @@ private function findAnonymousComponents(): array ->name('*.html.twig') ; foreach ($finderTemplates as $template) { - $component = str_replace('/', ':', $template->getRelativePathname()); + $component = str_replace(\DIRECTORY_SEPARATOR, ':', $template->getRelativePathname()); $component = substr($component, 0, -10); // remove file extension ".html.twig" $path = $template->getPath(); if ($template->getRelativePath()) { - $path = \rtrim(\substr($template->getPath(), 0, -1 * \strlen($template->getRelativePath())), '/'); + $path = \rtrim(\substr($template->getPath(), 0, -1 * \strlen($template->getRelativePath())), \DIRECTORY_SEPARATOR); } if (isset($dirs[$path]) && FilesystemLoader::MAIN_NAMESPACE !== $dirs[$path]) {