Skip to content

Commit b52d312

Browse files
committed
4.0 | Standards/Squiz: add parameter types to sniffs
1 parent c0f8a91 commit b52d312

File tree

71 files changed

+108
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+108
-107
lines changed

src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function register()
4040
*
4141
* @return void
4242
*/
43-
public function process(File $phpcsFile, $stackPtr)
43+
public function process(File $phpcsFile, int $stackPtr)
4444
{
4545
$tokens = $phpcsFile->getTokens();
4646

src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function register()
4141
*
4242
* @return void
4343
*/
44-
public function process(File $phpcsFile, $stackPtr)
44+
public function process(File $phpcsFile, int $stackPtr)
4545
{
4646
$tokens = $phpcsFile->getTokens();
4747

@@ -161,7 +161,7 @@ public function process(File $phpcsFile, $stackPtr)
161161
*
162162
* @return void
163163
*/
164-
public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd)
164+
public function processSingleLineArray(File $phpcsFile, int $stackPtr, int $arrayStart, int $arrayEnd)
165165
{
166166
$tokens = $phpcsFile->getTokens();
167167

@@ -335,7 +335,7 @@ public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arra
335335
*
336336
* @return void
337337
*/
338-
public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd)
338+
public function processMultiLineArray(File $phpcsFile, int $stackPtr, int $arrayStart, int $arrayEnd)
339339
{
340340
$tokens = $phpcsFile->getTokens();
341341
$keywordStart = $tokens[$stackPtr]['column'];

src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ClassDeclarationSniff extends PSR2ClassDeclarationSniff
2626
*
2727
* @return void
2828
*/
29-
public function process(File $phpcsFile, $stackPtr)
29+
public function process(File $phpcsFile, int $stackPtr)
3030
{
3131
// We want all the errors from the PSR2 standard, plus some of our own.
3232
parent::process($phpcsFile, $stackPtr);
@@ -51,7 +51,7 @@ public function process(File $phpcsFile, $stackPtr)
5151
*
5252
* @return void
5353
*/
54-
public function processOpen(File $phpcsFile, $stackPtr)
54+
public function processOpen(File $phpcsFile, int $stackPtr)
5555
{
5656
parent::processOpen($phpcsFile, $stackPtr);
5757

@@ -96,7 +96,7 @@ public function processOpen(File $phpcsFile, $stackPtr)
9696
*
9797
* @return void
9898
*/
99-
public function processClose(File $phpcsFile, $stackPtr)
99+
public function processClose(File $phpcsFile, int $stackPtr)
100100
{
101101
$tokens = $phpcsFile->getTokens();
102102
if (isset($tokens[$stackPtr]['scope_closer']) === false) {

src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function register()
4242
* @return int|void Integer stack pointer to skip forward or void to continue
4343
* normal file processing.
4444
*/
45-
public function process(File $phpcsFile, $stackPtr)
45+
public function process(File $phpcsFile, int $stackPtr)
4646
{
4747
$fullPath = $phpcsFile->getFilename();
4848
if ($fullPath === 'STDIN') {

src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function register()
4747
*
4848
* @return void
4949
*/
50-
public function process(File $phpcsFile, $stackPtr)
50+
public function process(File $phpcsFile, int $stackPtr)
5151
{
5252
$tokens = $phpcsFile->getTokens();
5353

src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct()
4141
*
4242
* @return void
4343
*/
44-
protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope)
44+
protected function processTokenWithinScope(File $phpcsFile, int $stackPtr, int $currScope)
4545
{
4646
$tokens = $phpcsFile->getTokens();
4747

@@ -165,7 +165,7 @@ protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScop
165165
*
166166
* @return void
167167
*/
168-
protected function processTokenOutsideScope(File $phpcsFile, $stackPtr)
168+
protected function processTokenOutsideScope(File $phpcsFile, int $stackPtr)
169169
{
170170

171171
}//end processTokenOutsideScope()
@@ -180,7 +180,7 @@ protected function processTokenOutsideScope(File $phpcsFile, $stackPtr)
180180
*
181181
* @return string
182182
*/
183-
protected function getNamespaceName(File $phpcsFile, $stackPtr)
183+
protected function getNamespaceName(File $phpcsFile, int $stackPtr)
184184
{
185185
$namespace = '\\';
186186
$namespaceDeclaration = $phpcsFile->findPrevious(T_NAMESPACE, $stackPtr);

src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function register()
4444
*
4545
* @return void
4646
*/
47-
public function process(File $phpcsFile, $stackPtr)
47+
public function process(File $phpcsFile, int $stackPtr)
4848
{
4949
$tokens = $phpcsFile->getTokens();
5050

src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function register()
4848
*
4949
* @return void
5050
*/
51-
public function process(File $phpcsFile, $stackPtr)
51+
public function process(File $phpcsFile, int $stackPtr)
5252
{
5353
if ($this->tabWidth === null) {
5454
if (isset($phpcsFile->config->tabWidth) === false || $phpcsFile->config->tabWidth === 0) {

src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function register()
4545
*
4646
* @return void
4747
*/
48-
public function process(File $phpcsFile, $stackPtr)
48+
public function process(File $phpcsFile, int $stackPtr)
4949
{
5050
$tokens = $phpcsFile->getTokens();
5151
$find = [

src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function register()
4343
*
4444
* @return void
4545
*/
46-
public function process(File $phpcsFile, $stackPtr)
46+
public function process(File $phpcsFile, int $stackPtr)
4747
{
4848
$tokens = $phpcsFile->getTokens();
4949

0 commit comments

Comments
 (0)