Skip to content

Commit 6d7cb92

Browse files
Try
1 parent 0291c75 commit 6d7cb92

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: src/Rules/Properties/AccessPropertiesCheck.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use PHPStan\Type\ErrorType;
2121
use PHPStan\Type\StaticType;
2222
use PHPStan\Type\Type;
23+
use PHPStan\Type\UnionType;
2324
use PHPStan\Type\VerbosityLevel;
2425
use function array_map;
2526
use function array_merge;
@@ -157,7 +158,7 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
157158
}
158159
}
159160

160-
if ($type->hasStaticProperty($name)->yes()) {
161+
if (!$type->hasStaticProperty($name)->no()) {
161162
return [
162163
RuleErrorBuilder::message(sprintf(
163164
'Non-static access to static property %s::$%s.',

Diff for: src/Rules/Properties/AccessStaticPropertiesRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ private function processSingleProperty(Scope $scope, StaticPropertyFetch $node,
200200
}
201201
}
202202

203-
if ($classType->hasInstanceProperty($name)->yes()) {
203+
if (!$classType->hasInstanceProperty($name)->no()) {
204204
$hasPropertyTypes = TypeUtils::getHasPropertyTypes($classType);
205205
foreach ($hasPropertyTypes as $hasPropertyType) {
206206
if ($hasPropertyType->getPropertyName() === $name) {

0 commit comments

Comments
 (0)