Skip to content

Commit

Permalink
allow open
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Sep 6, 2024
1 parent cf298dc commit 3763724
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Twig/TwigTemplateConstantExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private function findClassConstantFetchesInFile(string $filePath): array
{
$fileContents = FileSystem::read($filePath);

$constantMatches = Strings::matchAll($fileContents, '#{{\s*constant\(\s*([\'"])(?<constant>.*?)\1#');
$constantMatches = Strings::matchAll($fileContents, '#{{.*?\s*constant\(\s*([\'"])(?<constant>.*?)\1#');
$externalClassAccessConstantFetches = [];
foreach ($constantMatches as $constantMatch) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Here we use constant, it should stay public:
{{ constant('Rector\\SwissKnife\\Tests\\Twig\\TwigTemplateConstantExtractor\\Fixture\\SomeTemplateUsedConstant::STAY_PUBLIC') }}


We can use it again here: {{ constant('Rector\\SwissKnife\\Tests\\Twig\\TwigTemplateConstantExtractor\\Fixture\\SomeTemplateUsedConstant::STAY_PUBLIC') }}
We can use it again here: {{ value is constant('Rector\\SwissKnife\\Tests\\Twig\\TwigTemplateConstantExtractor\\Fixture\\SomeTemplateUsedConstant::STAY_PUBLIC') }}

0 comments on commit 3763724

Please sign in to comment.