Skip to content

Commit

Permalink
avoid double private
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Sep 6, 2024
1 parent 32425e8 commit 880a539
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Command/PrivatizeConstantsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private function processFileInfo(SplFileInfo $phpFileInfo, array $classConstantF
// make private
$changedFileContents = Strings::replace(
$phpFileInfo->getContents(),
'#((public|protected)\s+)?const\s+' . $classConstant->getConstantName() . '#',
'#((private|public|protected)\s+)?const\s+' . $classConstant->getConstantName() . '#',
'private const ' . $classConstant->getConstantName()
);
FileSystem::write($phpFileInfo->getRealPath(), $changedFileContents);
Expand Down

0 comments on commit 880a539

Please sign in to comment.