@@ -123,7 +123,7 @@ final public function register()
123123 *
124124 * @return array<int, int>
125125 */
126- private function getPatternTokenTypes ($ pattern )
126+ private function getPatternTokenTypes (array $ pattern )
127127 {
128128 $ tokenTypes = [];
129129 foreach ($ pattern as $ pos => $ patternInfo ) {
@@ -149,7 +149,7 @@ private function getPatternTokenTypes($pattern)
149149 * as the listener.
150150 * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If we could not determine a token to listen for.
151151 */
152- private function getListenerTokenPos ($ pattern )
152+ private function getListenerTokenPos (array $ pattern )
153153 {
154154 $ tokenTypes = $ this ->getPatternTokenTypes ($ pattern );
155155 $ tokenCodes = array_keys ($ tokenTypes );
@@ -178,7 +178,7 @@ private function getListenerTokenPos($pattern)
178178 * @return void
179179 * @see register()
180180 */
181- final public function process (File $ phpcsFile , $ stackPtr )
181+ final public function process (File $ phpcsFile , int $ stackPtr )
182182 {
183183 $ file = $ phpcsFile ->getFilename ();
184184 if ($ this ->currFile !== $ file ) {
@@ -246,7 +246,7 @@ final public function process(File $phpcsFile, $stackPtr)
246246 *
247247 * @return array|false
248248 */
249- protected function processPattern ($ patternInfo , File $ phpcsFile , $ stackPtr )
249+ protected function processPattern (array $ patternInfo , File $ phpcsFile , int $ stackPtr )
250250 {
251251 $ tokens = $ phpcsFile ->getTokens ();
252252 $ pattern = $ patternInfo ['pattern ' ];
@@ -697,7 +697,7 @@ protected function processPattern($patternInfo, File $phpcsFile, $stackPtr)
697697 *
698698 * @return string The error message.
699699 */
700- protected function prepareError ($ found , $ patternCode )
700+ protected function prepareError (string $ found , string $ patternCode )
701701 {
702702 $ found = str_replace ("\r\n" , '\n ' , $ found );
703703 $ found = str_replace ("\n" , '\n ' , $ found );
@@ -749,7 +749,7 @@ protected function registerSupplementary()
749749 * @return void
750750 * @see registerSupplementary()
751751 */
752- protected function processSupplementary (File $ phpcsFile , $ stackPtr )
752+ protected function processSupplementary (File $ phpcsFile , int $ stackPtr )
753753 {
754754
755755 }//end processSupplementary()
@@ -764,7 +764,7 @@ protected function processSupplementary(File $phpcsFile, $stackPtr)
764764 * @see createSkipPattern()
765765 * @see createTokenPattern()
766766 */
767- private function parse ($ pattern )
767+ private function parse (string $ pattern )
768768 {
769769 $ patterns = [];
770770 $ length = strlen ($ pattern );
@@ -855,7 +855,7 @@ private function parse($pattern)
855855 * @see createTokenPattern()
856856 * @see parse()
857857 */
858- private function createSkipPattern ($ pattern , $ from )
858+ private function createSkipPattern (string $ pattern , int $ from )
859859 {
860860 $ skip = ['type ' => 'skip ' ];
861861
@@ -908,7 +908,7 @@ private function createSkipPattern($pattern, $from)
908908 * @see createSkipPattern()
909909 * @see parse()
910910 */
911- private function createTokenPattern ($ str )
911+ private function createTokenPattern (string $ str )
912912 {
913913 // Pause the StatusWriter to silence Tokenizer debug info about the patterns being parsed (which only confuses things).
914914 StatusWriter::pause ();
0 commit comments