Skip to content

Commit 295e25d

Browse files
committed
Updated coding standard
1 parent 89b2a13 commit 295e25d

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
"nette/utils": "^2.3.0 || ^3.0.0"
1414
},
1515
"require-dev": {
16-
"consistence/coding-standard": "~0.12.0",
16+
"consistence/coding-standard": "~0.13.0",
17+
"jakub-onderka/php-parallel-lint": "^0.9.2",
1718
"phing/phing": "^2.13.0",
1819
"phpunit/phpunit": "^5.3",
1920
"satooshi/php-coveralls": "^1.0",
20-
"slevomat/coding-standard": "dev-php7#961090ac32"
21+
"slevomat/coding-standard": "^2.0"
2122
},
2223
"autoload": {
2324
"psr-4": {

ruleset.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
88
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
99
</rule>
10-
<rule ref="SlevomatCodingStandard.Typehints.TypeHintDeclaration">
10+
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
1111
<properties>
1212
<property name="usefulAnnotations" type="array" value="
1313
@dataProvider
1414
"/>
15+
<property name="enableNullableTypeHints" type="false" />
16+
<property name="enableVoidTypeHint" type="false" />
1517
</properties>
1618
</rule>
1719
</ruleset>

src/Reflection/Nette/HtmlMethodReflection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public function isStatic(): bool
3838
return false;
3939
}
4040

41+
/**
42+
* @return \PHPStan\Reflection\ParameterReflection[]
43+
*/
4144
public function getParameters(): array
4245
{
4346
return [];

src/Reflection/Nette/NetteObjectClassReflectionExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ public function hasProperty(ClassReflection $classReflection, string $propertyNa
2222
return false; // prevent infinite loop from hasMethod
2323
}
2424

25-
// todo setter taky?
26-
2725
$getterMethod = $this->getMethodByProperty($classReflection, $propertyName);
2826
if ($getterMethod === null) {
2927
return false;
@@ -75,6 +73,10 @@ public function getMethod(ClassReflection $classReflection, string $methodName):
7573
return new NetteObjectEventListenerMethodReflection($methodName, $classReflection);
7674
}
7775

76+
/**
77+
* @param \ReflectionClass $class
78+
* @return string[]
79+
*/
7880
private function getTraitNames(\ReflectionClass $class): array
7981
{
8082
$traitNames = $class->getTraitNames();

src/Reflection/Nette/SmartObjectPropertiesClassReflectionExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public function hasProperty(ClassReflection $classReflection, string $propertyNa
3939
return $getterMethod->isPublic();
4040
}
4141

42+
/**
43+
* @param \ReflectionClass $class
44+
* @return string[]
45+
*/
4246
private function getTraitNames(\ReflectionClass $class): array
4347
{
4448
$traitNames = $class->getTraitNames();

tests/Reflection/Nette/HtmlClassReflectionExtensionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ protected function setUp()
1717
$this->extension = new HtmlClassReflectionExtension();
1818
}
1919

20+
/**
21+
* @return mixed[]
22+
*/
2023
public function dataHasMethod(): array
2124
{
2225
return [
@@ -60,6 +63,9 @@ public function testGetMethod()
6063
$this->assertFalse($methodReflection->getReturnType()->isNullable());
6164
}
6265

66+
/**
67+
* @return mixed[]
68+
*/
6369
public function dataHasProperty(): array
6470
{
6571
return [

0 commit comments

Comments
 (0)