File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,13 @@ private function countArguments( $phpcsFile, $stackPtr ) { // phpcs:ignore Gener
112112 $ tokens = $ phpcsFile ->getTokens ();
113113 $ openParenthesis = $ phpcsFile ->findNext ( [ T_OPEN_PARENTHESIS ], $ stackPtr + 1 );
114114 $ lastPosition = $ tokens [ $ openParenthesis ]['parenthesis_closer ' ] - 1 ;
115- $ currentPosition = $ phpcsFile ->findNext ( T_COMMA , $ stackPtr + 1 ) + 1 ;
115+ $ commaPtr = $ phpcsFile ->findNext ( T_COMMA , $ stackPtr + 1 );
116+
117+ if ( $ commaPtr === false ) {
118+ return 0 ;
119+ }
120+
121+ $ currentPosition = $ commaPtr + 1 ;
116122 $ quantity = 0 ;
117123
118124 while ( $ currentPosition < $ lastPosition ) {
Original file line number Diff line number Diff line change @@ -180,3 +180,6 @@ function () {
180180
181181/** This action is documented in some-class.php. */
182182do_action ( 'wpforms_display_submit_after ' , $ this ->displaysubmit_after_action );
183+
184+ // This case generated 'You should have 39 @param tags' (39 as an example).
185+ do_action ( 'hook_without_args ' );
You can’t perform that action at this time.
0 commit comments