public function removeProperty($propertyName)
{
$lowerName = strtolower($propertyName);
foreach ($this->node->stmts as $key => $stmt) {
if ($stmt instanceof PropertyNode) {
$propertyNames = array_map(function (Node\Stmt\PropertyProperty $propertyProperty) {
return strtolower($propertyProperty->name);
}, $stmt->props);
if (in_array($lowerName, $propertyNames, true)) {
$this->cachedProperties = null;
unset($this->node->stmts[$key]);
return true;
}
}
}
return false;
}