Skip to content

Commit 03bb7fe

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

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ test:
1313
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/TypeHints/ParameterTypeHintSpacing.php | tests/errorNumber.sh 2
1414
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Formatting/SpaceAfterCast.php | tests/errorNumber.sh 2
1515
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Exceptions/DeadCatch.php | tests/errorNumber.sh 1
16+
./vendor/bin/phpcs --standard=src/PeckaCodingStandardStrict/ruleset.xml tests/Failure/TypeHints/ParameterTypeHint.php | tests/errorNumber.sh 1

src/PeckaCodingStandardStrict/ruleset.xml

Lines changed: 1 addition & 0 deletions
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"/>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php declare(strict_types = 1);
2+
3+
class MyClass
4+
{
5+
6+
public function hello($id): void
7+
{
8+
9+
}
10+
11+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php declare(strict_types = 1);
2+
3+
class MyClass
4+
{
5+
6+
public function hello(string $id): void
7+
{
8+
9+
}
10+
11+
12+
/**
13+
* @param string|int|bool $id
14+
*/
15+
public function hello2($id): void
16+
{
17+
18+
}
19+
20+
}

0 commit comments

Comments
 (0)