Skip to content

Commit 41d2cbc

Browse files
committed
[StimulusBundle] Handles Windows directory separator when normalizing controller names (fixes #1422)
1 parent 1a4bdc0 commit 41d2cbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/StimulusBundle/src/AssetMapper/ControllersMapGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private function loadCustomControllers(): array
7676
// use regex to extract 'controller'-postfix including extension
7777
preg_match(self::FILENAME_REGEX, $name, $matches);
7878
$name = str_replace(['_'.$matches[1], '-'.$matches[1]], '', $name);
79-
$name = str_replace(['_', '/'], ['-', '--'], $name);
79+
$name = str_replace(['_', '/', '\\'], ['-', '--', '--'], $name);
8080

8181
$asset = $this->assetMapper->getAssetFromSourcePath($file->getRealPath());
8282
$content = $asset->content ?: file_get_contents($asset->sourcePath);

0 commit comments

Comments
 (0)