public function ClassNode::addProperty in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php \Prophecy\Doubler\Generator\Node\ClassNode::addProperty()
File
- vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ Generator/ Node/ ClassNode.php, line 80
Class
- ClassNode
- Class node.
Namespace
Prophecy\Doubler\Generator\NodeCode
public function addProperty($name, $visibility = 'public') {
$visibility = strtolower($visibility);
if (!in_array($visibility, array(
'public',
'private',
'protected',
))) {
throw new InvalidArgumentException(sprintf('`%s` property visibility is not supported.', $visibility));
}
$this->properties[$name] = $visibility;
}