Skip to content

Commit d0ce95d

Browse files
committed
CS hlídá typy parametrů metod
1 parent ea955a2 commit d0ce95d

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ test:
1111
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Formatting/SpaceAfterCast.php | tests/errorNumber.sh 2
1212
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/WhiteSpace/DisallowSpaceIndent.php | tests/errorNumber.sh 2
1313
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/TypeHints/ParameterTypeHintSpacing.php | tests/errorNumber.sh 2
14+
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/TypeHints/ParameterTypeHint.php | tests/errorNumber.sh 2
1415
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Formatting/SpaceAfterCast.php | tests/errorNumber.sh 2
1516
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Exceptions/DeadCatch.php | tests/errorNumber.sh 1

src/PeckaCodingStandardStrict/ruleset.xml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<!-- TypeHints -->
1414
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
1515
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
16+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/>
1617

1718
<!-- Namespaces -->
1819
<rule ref="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
class MyClass {
4+
5+
private function hello($id) {
6+
7+
}
8+
9+
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
class MyClass
4+
{
5+
6+
private function hello(string $id)
7+
{
8+
9+
}
10+
11+
12+
/**
13+
* @param string|int|bool $id
14+
*/
15+
private function hello2($id)
16+
{
17+
18+
}
19+
20+
}

0 commit comments

Comments
 (0)