Skip to content

Commit dcf222a

Browse files
author
Matthias Leutenegger
committed
extension is also considered configurable
1 parent d13741b commit dcf222a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Reflection/ReadWritePropertiesExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PHPStan\Reflection\PropertyReflection;
66
use SilverStripe\Core\Config\Configurable;
7+
use SilverStripe\Core\Extension;
78

89
/**
910
* Adds information about configuration properties, which are always read,
@@ -77,6 +78,7 @@ public function containsConfigBlock(PropertyReflection $property): bool
7778
*/
7879
public function classUsesConfigTrait(PropertyReflection $property): bool
7980
{
80-
return $property->getDeclaringClass()->hasTraitUse(Configurable::class);
81+
$classReflection = $property->getDeclaringClass();
82+
return $classReflection->hasTraitUse(Configurable::class) || $classReflection->isSubclassOf(Extension::class);
8183
}
8284
}

0 commit comments

Comments
 (0)