Skip to content

Commit

Permalink
fix: replace / by DIRECTORY_SEPARATOR
Browse files Browse the repository at this point in the history
  • Loading branch information
clussiana committed Nov 4, 2024
1 parent e514572 commit d906c6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TwigComponent/src/Command/TwigComponentDebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down

0 comments on commit d906c6e

Please # to comment.