@@ -482,7 +482,7 @@ protected function markVariableDeclaration(
482
482
// we catch declarations that come after implicit declarations like
483
483
// use of a variable as a local.
484
484
$ this ->addWarning (
485
- " Redeclaration of %s %s as %s. " ,
485
+ ' Redeclaration of %s %s as %s. ' ,
486
486
$ stackPtr ,
487
487
'VariableRedeclaration ' ,
488
488
[
@@ -625,28 +625,28 @@ protected function markAllVariablesRead(File $phpcsFile, $stackPtr) {
625
625
* @return void
626
626
*/
627
627
protected function processVariableAsFunctionDefinitionArgument (File $ phpcsFile , $ stackPtr , $ varName , $ outerScope ) {
628
- Helpers::debug (" processVariableAsFunctionDefinitionArgument " , $ stackPtr , $ varName );
628
+ Helpers::debug (' processVariableAsFunctionDefinitionArgument ' , $ stackPtr , $ varName );
629
629
$ tokens = $ phpcsFile ->getTokens ();
630
630
631
631
$ functionPtr = Helpers::getFunctionIndexForFunctionArgument ($ phpcsFile , $ stackPtr );
632
632
if (! is_int ($ functionPtr )) {
633
633
throw new \Exception ("Function index not found for function argument index {$ stackPtr }" );
634
634
}
635
635
636
- Helpers::debug (" processVariableAsFunctionDefinitionArgument found function definition " , $ tokens [$ functionPtr ]);
636
+ Helpers::debug (' processVariableAsFunctionDefinitionArgument found function definition ' , $ tokens [$ functionPtr ]);
637
637
$ this ->markVariableDeclaration ($ varName , ScopeType::PARAM , null , $ stackPtr , $ functionPtr );
638
638
639
639
// Are we pass-by-reference?
640
640
$ referencePtr = $ phpcsFile ->findPrevious (Tokens::$ emptyTokens , $ stackPtr - 1 , null , true , null , true );
641
641
if (($ referencePtr !== false ) && ($ tokens [$ referencePtr ]['code ' ] === T_BITWISE_AND )) {
642
- Helpers::debug (" processVariableAsFunctionDefinitionArgument found pass-by-reference to scope " , $ outerScope );
642
+ Helpers::debug (' processVariableAsFunctionDefinitionArgument found pass-by-reference to scope ' , $ outerScope );
643
643
$ varInfo = $ this ->getOrCreateVariableInfo ($ varName , $ functionPtr );
644
644
$ varInfo ->referencedVariableScope = $ outerScope ;
645
645
}
646
646
647
647
// Are we optional with a default?
648
648
if (Helpers::getNextAssignPointer ($ phpcsFile , $ stackPtr ) !== null ) {
649
- Helpers::debug (" processVariableAsFunctionDefinitionArgument optional with default " );
649
+ Helpers::debug (' processVariableAsFunctionDefinitionArgument optional with default ' );
650
650
$ this ->markVariableAssignment ($ varName , $ stackPtr , $ functionPtr );
651
651
}
652
652
}
@@ -664,7 +664,7 @@ protected function processVariableAsFunctionDefinitionArgument(File $phpcsFile,
664
664
protected function processVariableAsUseImportDefinition (File $ phpcsFile , $ stackPtr , $ varName , $ outerScope ) {
665
665
$ tokens = $ phpcsFile ->getTokens ();
666
666
667
- Helpers::debug (" processVariableAsUseImportDefinition " , $ stackPtr , $ varName , $ outerScope );
667
+ Helpers::debug (' processVariableAsUseImportDefinition ' , $ stackPtr , $ varName , $ outerScope );
668
668
669
669
$ endOfArgsPtr = $ phpcsFile ->findPrevious ([T_CLOSE_PARENTHESIS ], $ stackPtr - 1 , null );
670
670
if (! is_int ($ endOfArgsPtr )) {
@@ -1194,7 +1194,7 @@ protected function processVariableAsForeachLoopVar(File $phpcsFile, $stackPtr, $
1194
1194
// Are we pass-by-reference?
1195
1195
$ referencePtr = $ phpcsFile ->findPrevious (Tokens::$ emptyTokens , $ stackPtr - 1 , null , true , null , true );
1196
1196
if (($ referencePtr !== false ) && ($ tokens [$ referencePtr ]['code ' ] === T_BITWISE_AND )) {
1197
- Helpers::debug (" processVariableAsForeachLoopVar: found foreach loop variable assigned by reference " );
1197
+ Helpers::debug (' processVariableAsForeachLoopVar: found foreach loop variable assigned by reference ' );
1198
1198
$ varInfo ->isDynamicReference = true ;
1199
1199
}
1200
1200
@@ -1548,7 +1548,7 @@ protected function processVariableInString(File $phpcsFile, $stackPtr) {
1548
1548
if (!preg_match_all (Constants::getDoubleQuotedVarRegexp (), $ token ['content ' ], $ matches )) {
1549
1549
return ;
1550
1550
}
1551
- Helpers::debug (" examining token for variable in string " , $ token );
1551
+ Helpers::debug (' examining token for variable in string ' , $ token );
1552
1552
1553
1553
foreach ($ matches [1 ] as $ varName ) {
1554
1554
$ varName = Helpers::normalizeVarName ($ varName );
@@ -1726,7 +1726,7 @@ protected function warnAboutUnusedVariable(File $phpcsFile, VariableInfo $varInf
1726
1726
foreach (array_unique ($ varInfo ->allAssignments ) as $ indexForWarning ) {
1727
1727
Helpers::debug ("variable {$ varInfo ->name } at end of scope looks unused " );
1728
1728
$ phpcsFile ->addWarning (
1729
- " Unused %s %s. " ,
1729
+ ' Unused %s %s. ' ,
1730
1730
$ indexForWarning ,
1731
1731
'UnusedVariable ' ,
1732
1732
[
@@ -1746,7 +1746,7 @@ protected function warnAboutUnusedVariable(File $phpcsFile, VariableInfo $varInf
1746
1746
*/
1747
1747
protected function warnAboutUndefinedVariable (File $ phpcsFile , $ varName , $ stackPtr ) {
1748
1748
$ phpcsFile ->addWarning (
1749
- " Variable %s is undefined. " ,
1749
+ ' Variable %s is undefined. ' ,
1750
1750
$ stackPtr ,
1751
1751
'UndefinedVariable ' ,
1752
1752
["\${$ varName }" ]
@@ -1762,7 +1762,7 @@ protected function warnAboutUndefinedVariable(File $phpcsFile, $varName, $stackP
1762
1762
*/
1763
1763
protected function warnAboutUndefinedArrayPushShortcut (File $ phpcsFile , $ varName , $ stackPtr ) {
1764
1764
$ phpcsFile ->addWarning (
1765
- " Array variable %s is undefined. " ,
1765
+ ' Array variable %s is undefined. ' ,
1766
1766
$ stackPtr ,
1767
1767
'UndefinedVariable ' ,
1768
1768
["\${$ varName }" ]
@@ -1778,7 +1778,7 @@ protected function warnAboutUndefinedArrayPushShortcut(File $phpcsFile, $varName
1778
1778
*/
1779
1779
protected function warnAboutUndefinedUnset (File $ phpcsFile , $ varName , $ stackPtr ) {
1780
1780
$ phpcsFile ->addWarning (
1781
- " Variable %s inside unset call is undefined. " ,
1781
+ ' Variable %s inside unset call is undefined. ' ,
1782
1782
$ stackPtr ,
1783
1783
'UndefinedUnsetVariable ' ,
1784
1784
["\${$ varName }" ]
0 commit comments