public function addProperty($propertyName, $visibility = \ReflectionProperty::IS_PUBLIC, $static = false)
{
$type = 0;
switch ($visibility) {
case \ReflectionProperty::IS_PRIVATE:
$type |= ClassNode::MODIFIER_PRIVATE;
break;
case \ReflectionProperty::IS_PROTECTED:
$type |= ClassNode::MODIFIER_PROTECTED;
break;
default:
$type |= ClassNode::MODIFIER_PUBLIC;
break;
}
if ($static) {
$type |= ClassNode::MODIFIER_STATIC;
}
$this->node->stmts[] = new PropertyNode($type, [new Node\Stmt\PropertyProperty($propertyName)]);
$this->cachedProperties = null;
}