@@ -123,7 +123,7 @@ final public function register()
123
123
*
124
124
* @return array<int, int>
125
125
*/
126
- private function getPatternTokenTypes ($ pattern )
126
+ private function getPatternTokenTypes (array $ pattern )
127
127
{
128
128
$ tokenTypes = [];
129
129
foreach ($ pattern as $ pos => $ patternInfo ) {
@@ -149,7 +149,7 @@ private function getPatternTokenTypes($pattern)
149
149
* as the listener.
150
150
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If we could not determine a token to listen for.
151
151
*/
152
- private function getListenerTokenPos ($ pattern )
152
+ private function getListenerTokenPos (array $ pattern )
153
153
{
154
154
$ tokenTypes = $ this ->getPatternTokenTypes ($ pattern );
155
155
$ tokenCodes = array_keys ($ tokenTypes );
@@ -178,7 +178,7 @@ private function getListenerTokenPos($pattern)
178
178
* @return void
179
179
* @see register()
180
180
*/
181
- final public function process (File $ phpcsFile , $ stackPtr )
181
+ final public function process (File $ phpcsFile , int $ stackPtr )
182
182
{
183
183
$ file = $ phpcsFile ->getFilename ();
184
184
if ($ this ->currFile !== $ file ) {
@@ -246,7 +246,7 @@ final public function process(File $phpcsFile, $stackPtr)
246
246
*
247
247
* @return array|false
248
248
*/
249
- protected function processPattern ($ patternInfo , File $ phpcsFile , $ stackPtr )
249
+ protected function processPattern (array $ patternInfo , File $ phpcsFile , int $ stackPtr )
250
250
{
251
251
$ tokens = $ phpcsFile ->getTokens ();
252
252
$ pattern = $ patternInfo ['pattern ' ];
@@ -697,7 +697,7 @@ protected function processPattern($patternInfo, File $phpcsFile, $stackPtr)
697
697
*
698
698
* @return string The error message.
699
699
*/
700
- protected function prepareError ($ found , $ patternCode )
700
+ protected function prepareError (string $ found , string $ patternCode )
701
701
{
702
702
$ found = str_replace ("\r\n" , '\n ' , $ found );
703
703
$ found = str_replace ("\n" , '\n ' , $ found );
@@ -749,7 +749,7 @@ protected function registerSupplementary()
749
749
* @return void
750
750
* @see registerSupplementary()
751
751
*/
752
- protected function processSupplementary (File $ phpcsFile , $ stackPtr )
752
+ protected function processSupplementary (File $ phpcsFile , int $ stackPtr )
753
753
{
754
754
755
755
}//end processSupplementary()
@@ -764,7 +764,7 @@ protected function processSupplementary(File $phpcsFile, $stackPtr)
764
764
* @see createSkipPattern()
765
765
* @see createTokenPattern()
766
766
*/
767
- private function parse ($ pattern )
767
+ private function parse (string $ pattern )
768
768
{
769
769
$ patterns = [];
770
770
$ length = strlen ($ pattern );
@@ -855,7 +855,7 @@ private function parse($pattern)
855
855
* @see createTokenPattern()
856
856
* @see parse()
857
857
*/
858
- private function createSkipPattern ($ pattern , $ from )
858
+ private function createSkipPattern (string $ pattern , int $ from )
859
859
{
860
860
$ skip = ['type ' => 'skip ' ];
861
861
@@ -908,7 +908,7 @@ private function createSkipPattern($pattern, $from)
908
908
* @see createSkipPattern()
909
909
* @see parse()
910
910
*/
911
- private function createTokenPattern ($ str )
911
+ private function createTokenPattern (string $ str )
912
912
{
913
913
// Pause the StatusWriter to silence Tokenizer debug info about the patterns being parsed (which only confuses things).
914
914
StatusWriter::pause ();
0 commit comments