Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit e40a3da

Browse files
committed
Fixed compatibility with PHPStan 0.12
1 parent 147bc06 commit e40a3da

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/Reflection/PHPParser/NamespacedNameProperty.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ class NamespacedNameProperty implements \PHPStan\Reflection\PropertyReflection
1414
/** @var \PHPStan\Reflection\ClassReflection */
1515
private $declaringClass;
1616

17+
/** @var Type */
18+
private $type;
19+
1720
public function __construct(ClassReflection $declaringClass)
1821
{
1922
$this->declaringClass = $declaringClass;
23+
$this->type = new ObjectType(Name::class);
2024
}
2125

2226
public function getDeclaringClass(): ClassReflection
@@ -39,9 +43,19 @@ public function isPublic(): bool
3943
return true;
4044
}
4145

42-
public function getType(): Type
46+
public function getReadableType(): Type
47+
{
48+
return $this->type;
49+
}
50+
51+
public function getWritableType(): Type
4352
{
44-
return new ObjectType(Name::class);
53+
return $this->type;
54+
}
55+
56+
public function canChangeTypeAfterAssignment(): bool
57+
{
58+
return false;
4559
}
4660

4761
public function isReadable(): bool

0 commit comments

Comments
 (0)