File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -143,16 +143,17 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
143
143
return ;
144
144
};
145
145
$ propertyName = trim ($ tokens [$ propertyNamePosition ]['content ' ], '$ ' );
146
+ $ shortDescription = strtolower ($ tokens [$ isShortDescriptionPreviousVar ]['content ' ]);
146
147
147
- if (strtolower ( $ tokens [ $ isShortDescriptionPreviousVar ][ ' content ' ]) === strtolower ($ propertyName )) {
148
+ if ($ shortDescription === strtolower ($ propertyName )) {
148
149
$ error = 'Short description duplicates class property name. ' ;
149
150
$ phpcsFile ->addWarning ($ error , $ isShortDescriptionPreviousVar , 'AlreadyHaveMeaningfulNameVar ' );
150
151
return ;
151
152
}
152
153
153
154
$ propertyNameParts = array_filter (preg_split ('/(?=[A-Z])/ ' , $ propertyName ));
154
155
155
- if (strtolower ( $ tokens [ $ isShortDescriptionPreviousVar ][ ' content ' ]) === strtolower (implode (' ' , $ propertyNameParts ))) {
156
+ if ($ shortDescription === strtolower (implode (' ' , $ propertyNameParts ))) {
156
157
$ error = 'Short description duplicates class property name. ' ;
157
158
$ phpcsFile ->addWarning ($ error , $ isShortDescriptionPreviousVar , 'AlreadyHaveMeaningfulNameVar ' );
158
159
}
You can’t perform that action at this time.
0 commit comments