Skip to content

Commit a852c60

Browse files
💄 Add typing
1 parent f94f876 commit a852c60

Some content is hidden

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

46 files changed

+145
-163
lines changed

SymfonyCustom/Sniffs/SniffHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SniffHelper
1818
*
1919
* @return bool
2020
*/
21-
public static function isNamespace(File $phpcsFile, $stackPtr)
21+
public static function isNamespace(File $phpcsFile, int $stackPtr): bool
2222
{
2323
$tokens = $phpcsFile->getTokens();
2424

@@ -37,7 +37,7 @@ public static function isNamespace(File $phpcsFile, $stackPtr)
3737
*
3838
* @return bool
3939
*/
40-
public static function isTraitUse(File $phpcsFile, $stackPtr)
40+
public static function isTraitUse(File $phpcsFile, int $stackPtr): bool
4141
{
4242
$tokens = $phpcsFile->getTokens();
4343

@@ -61,7 +61,7 @@ public static function isTraitUse(File $phpcsFile, $stackPtr)
6161
*
6262
* @return bool
6363
*/
64-
public static function isGlobalUse(File $phpcsFile, $stackPtr)
64+
public static function isGlobalUse(File $phpcsFile, int $stackPtr): bool
6565
{
6666
$tokens = $phpcsFile->getTokens();
6767

SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ArrayDeclarationUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
7 => 2,
@@ -65,7 +65,7 @@ public function getErrorList()
6565
*
6666
* @return array<int, int>
6767
*/
68-
public function getWarningList()
68+
protected function getWarningList(): array
6969
{
7070
return [];
7171
}

SymfonyCustom/Tests/Classes/ClassDeclarationUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ClassDeclarationUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
4 => 1,
@@ -35,7 +35,7 @@ public function getErrorList()
3535
*
3636
* @return array(int => int)
3737
*/
38-
public function getWarningList()
38+
protected function getWarningList(): array
3939
{
4040
return [];
4141
}

SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class PropertyDeclarationUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
9 => 1,
@@ -34,7 +34,7 @@ public function getErrorList()
3434
*
3535
* @return array(int => int)
3636
*/
37-
public function getWarningList()
37+
protected function getWarningList(): array
3838
{
3939
return [];
4040
}

SymfonyCustom/Tests/Commenting/ClassCommentUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ClassCommentUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
3 => 1,
@@ -34,7 +34,7 @@ public function getErrorList()
3434
*
3535
* @return array(int => int)
3636
*/
37-
protected function getWarningList()
37+
protected function getWarningList(): array
3838
{
3939
return [];
4040
}

SymfonyCustom/Tests/Commenting/DocCommentForbiddenTagsUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DocCommentForbiddenTagsUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
6 => 1,
@@ -39,7 +39,7 @@ public function getErrorList()
3939
*
4040
* @return array(int => int)
4141
*/
42-
protected function getWarningList()
42+
protected function getWarningList(): array
4343
{
4444
return [];
4545
}

SymfonyCustom/Tests/Commenting/DocCommentGroupSameTypeUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DocCommentGroupSameTypeUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
5 => 1,
@@ -44,7 +44,7 @@ public function getErrorList()
4444
*
4545
* @return array(int => int)
4646
*/
47-
protected function getWarningList()
47+
protected function getWarningList(): array
4848
{
4949
return [];
5050
}

SymfonyCustom/Tests/Commenting/DocCommentUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DocCommentUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
9 => 1,
@@ -44,7 +44,7 @@ public function getErrorList()
4444
*
4545
* @return array(int => int)
4646
*/
47-
protected function getWarningList()
47+
protected function getWarningList(): array
4848
{
4949
return [];
5050
}

SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class FunctionCommentUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
5 => 1,
@@ -42,7 +42,7 @@ public function getErrorList()
4242
*
4343
* @return array(int => int)
4444
*/
45-
protected function getWarningList()
45+
protected function getWarningList(): array
4646
{
4747
return [];
4848
}

SymfonyCustom/Tests/Commenting/VariableCommentUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class VariableCommentUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
21 => 1,
@@ -42,7 +42,7 @@ public function getErrorList()
4242
*
4343
* @return array<int, int>
4444
*/
45-
public function getWarningList()
45+
protected function getWarningList(): array
4646
{
4747
return [];
4848
}

SymfonyCustom/Tests/Errors/ExceptionMessageUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ExceptionMessageUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
17 => 1,
@@ -34,7 +34,7 @@ public function getErrorList()
3434
*
3535
* @return array(int => int)
3636
*/
37-
public function getWarningList()
37+
protected function getWarningList(): array
3838
{
3939
return [];
4040
}

SymfonyCustom/Tests/Errors/UserDeprecatedUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UserDeprecatedUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
30 => 1,
@@ -34,7 +34,7 @@ public function getErrorList()
3434
*
3535
* @return array(int => int)
3636
*/
37-
public function getWarningList()
37+
protected function getWarningList(): array
3838
{
3939
return [];
4040
}

SymfonyCustom/Tests/Formatting/BlankLineBeforeReturnUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BlankLineBeforeReturnUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array(int => int)
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
60 => 1,
@@ -36,7 +36,7 @@ public function getErrorList()
3636
*
3737
* @return array(int => int)
3838
*/
39-
public function getWarningList()
39+
protected function getWarningList(): array
4040
{
4141
return [];
4242
}

SymfonyCustom/Tests/Formatting/ConditionalReturnOrThrowUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ConditionalReturnOrThrowUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array(int => int)
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
22 => 1,
@@ -36,7 +36,7 @@ public function getErrorList()
3636
*
3737
* @return array(int => int)
3838
*/
39-
public function getWarningList()
39+
protected function getWarningList(): array
4040
{
4141
return [];
4242
}

SymfonyCustom/Tests/Formatting/StrictComparisonUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class StrictComparisonUnitTest extends AbstractSniffUnitTest
1616
*
1717
* @return array <int line number> => <int number of errors>
1818
*/
19-
public function getErrorList()
19+
protected function getErrorList(): array
2020
{
2121
return [];
2222
}
@@ -26,7 +26,7 @@ public function getErrorList()
2626
*
2727
* @return array <int line number> => <int number of warnings>
2828
*/
29-
public function getWarningList()
29+
protected function getWarningList(): array
3030
{
3131
return [
3232
3 => 1,

SymfonyCustom/Tests/Formatting/YodaConditionUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class YodaConditionUnitTest extends AbstractSniffUnitTest
1616
*
1717
* @return array <int line number> => <int number of errors>
1818
*/
19-
public function getErrorList()
19+
protected function getErrorList(): array
2020
{
2121
return [
2222
2 => 2,
@@ -40,7 +40,7 @@ public function getErrorList()
4040
*
4141
* @return array <int line number> => <int number of warnings>
4242
*/
43-
public function getWarningList()
43+
protected function getWarningList(): array
4444
{
4545
return [];
4646
}

SymfonyCustom/Tests/Functions/ScopeOrderUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ScopeOrderUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array(int => int)
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
9 => 1,
@@ -35,7 +35,7 @@ public function getErrorList()
3535
*
3636
* @return array(int => int)
3737
*/
38-
public function getWarningList()
38+
protected function getWarningList(): array
3939
{
4040
return [];
4141
}

SymfonyCustom/Tests/Namespaces/AlphabeticallySortedUseUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AlphabeticallySortedUseUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
7 => 1,
@@ -38,7 +38,7 @@ public function getErrorList()
3838
*
3939
* @return array(int => int)
4040
*/
41-
public function getWarningList()
41+
protected function getWarningList(): array
4242
{
4343
return [];
4444
}

SymfonyCustom/Tests/Namespaces/NamespaceDeclarationUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class NamespaceDeclarationUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
2 => 1,
@@ -36,7 +36,7 @@ public function getErrorList()
3636
*
3737
* @return array(int => int)
3838
*/
39-
public function getWarningList()
39+
protected function getWarningList(): array
4040
{
4141
return [];
4242
}

SymfonyCustom/Tests/Namespaces/UnusedUseUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UnusedUseUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
2525
12 => 1,
@@ -51,7 +51,7 @@ public function getErrorList()
5151
*
5252
* @return array(int => int)
5353
*/
54-
public function getWarningList()
54+
protected function getWarningList(): array
5555
{
5656
return [];
5757
}

SymfonyCustom/Tests/Namespaces/UseWithoutStartingBackslashUnitTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class UseWithoutStartingBackslashUnitTest extends AbstractSniffUnitTest
1919
*
2020
* @return array<int, int>
2121
*/
22-
public function getErrorList()
22+
protected function getErrorList(): array
2323
{
2424
return [
25-
2 => 1,
26-
3 => 1,
27-
4 => 1,
25+
5 => 1,
26+
6 => 1,
27+
7 => 1,
2828
];
2929
}
3030

@@ -36,7 +36,7 @@ public function getErrorList()
3636
*
3737
* @return array(int => int)
3838
*/
39-
public function getWarningList()
39+
protected function getWarningList(): array
4040
{
4141
return [];
4242
}

0 commit comments

Comments
 (0)