You are here

public function ClassNode::addProperty in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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\Node

Code

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;
}