Skip to content

Commit d906c6e

Browse files
committed
fix: replace / by DIRECTORY_SEPARATOR
1 parent e514572 commit d906c6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TwigComponent/src/Command/TwigComponentDebugCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ private function findAnonymousComponents(): array
182182
->name('*.html.twig')
183183
;
184184
foreach ($finderTemplates as $template) {
185-
$component = str_replace('/', ':', $template->getRelativePathname());
185+
$component = str_replace(\DIRECTORY_SEPARATOR, ':', $template->getRelativePathname());
186186
$component = substr($component, 0, -10); // remove file extension ".html.twig"
187187
$path = $template->getPath();
188188

189189
if ($template->getRelativePath()) {
190-
$path = \rtrim(\substr($template->getPath(), 0, -1 * \strlen($template->getRelativePath())), '/');
190+
$path = \rtrim(\substr($template->getPath(), 0, -1 * \strlen($template->getRelativePath())), \DIRECTORY_SEPARATOR);
191191
}
192192

193193
if (isset($dirs[$path]) && FilesystemLoader::MAIN_NAMESPACE !== $dirs[$path]) {

0 commit comments

Comments
 (0)