From 880a53903625b40d9ed4ed7841a1b57b6d8a75b1 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 6 Sep 2024 12:30:16 +0200 Subject: [PATCH] avoid double private --- src/Command/PrivatizeConstantsCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/PrivatizeConstantsCommand.php b/src/Command/PrivatizeConstantsCommand.php index 44afa5525..93320ae19 100644 --- a/src/Command/PrivatizeConstantsCommand.php +++ b/src/Command/PrivatizeConstantsCommand.php @@ -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);