Skip to content

Commit 348cb61

Browse files
rattusczondrejmirtes
authored andcommitted
Property isAlwaysWritten calls isInitialized as it's same check. Drop IPresenter implements requirement.
1 parent 7fc88eb commit 348cb61

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Rule/Nette/PresenterInjectedPropertiesExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ public function isAlwaysRead(PropertyReflection $property, string $propertyName)
1515

1616
public function isAlwaysWritten(PropertyReflection $property, string $propertyName): bool
1717
{
18-
return false;
18+
return $this->isInitialized($property, $propertyName);
1919
}
2020

2121
public function isInitialized(PropertyReflection $property, string $propertyName): bool
2222
{
2323
return $property->isPublic() &&
24-
$property->getDeclaringClass()->implementsInterface('Nette\Application\IPresenter') &&
2524
strpos($property->getDocComment() ?? '', '@inject') !== false;
2625
}
2726

0 commit comments

Comments
 (0)