Skip to content

Commit

Permalink
[StimulusBundle] Check controllers source files for laziness
Browse files Browse the repository at this point in the history
  • Loading branch information
MatTheCat committed Oct 26, 2024
1 parent 01839ab commit 8b5aff6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private function loadCustomControllers(): array
$name = str_replace(['_', '/', '\\'], ['-', '--', '--'], $name);

$asset = $this->assetMapper->getAssetFromSourcePath($file->getRealPath());
$content = $asset->content ?: file_get_contents($asset->sourcePath);
$content = file_get_contents($asset->sourcePath);
$isLazy = preg_match('/\/\*\s*stimulusFetch:\s*\'lazy\'\s*\*\//i', $content);

$controllersMap[$name] = new MappedControllerAsset($asset, $isLazy);
Expand Down

0 comments on commit 8b5aff6

Please sign in to comment.