class ClassNode in Zircon Profile 8
Same name in this branch
- 8 vendor/symfony/css-selector/Node/ClassNode.php \Symfony\Component\CssSelector\Node\ClassNode
- 8 vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php \Prophecy\Doubler\Generator\Node\ClassNode
Same name and namespace in other branches
- 8.0 vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php \Prophecy\Doubler\Generator\Node\ClassNode
Class node.
@author Konstantin Kudryashov <ever.zet@gmail.com>
Hierarchy
- class \Prophecy\Doubler\Generator\Node\ClassNode
Expanded class hierarchy of ClassNode
10 files declare their use of ClassNode
- ClassCreatorException.php in vendor/
phpspec/ prophecy/ src/ Prophecy/ Exception/ Doubler/ ClassCreatorException.php - ClassPatchInterface.php in vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ ClassPatch/ ClassPatchInterface.php - DisableConstructorPatch.php in vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ ClassPatch/ DisableConstructorPatch.php - HhvmExceptionPatch.php in vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ ClassPatch/ HhvmExceptionPatch.php - KeywordPatch.php in vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ ClassPatch/ KeywordPatch.php
File
- vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ Generator/ Node/ ClassNode.php, line 21
Namespace
Prophecy\Doubler\Generator\NodeView source
class ClassNode {
private $parentClass = 'stdClass';
private $interfaces = array();
private $properties = array();
/**
* @var MethodNode[]
*/
private $methods = array();
public function getParentClass() {
return $this->parentClass;
}
/**
* @param string $class
*/
public function setParentClass($class) {
$this->parentClass = $class ?: 'stdClass';
}
/**
* @return string[]
*/
public function getInterfaces() {
return $this->interfaces;
}
/**
* @param string $interface
*/
public function addInterface($interface) {
if ($this
->hasInterface($interface)) {
return;
}
array_unshift($this->interfaces, $interface);
}
/**
* @param string $interface
*
* @return bool
*/
public function hasInterface($interface) {
return in_array($interface, $this->interfaces);
}
public function getProperties() {
return $this->properties;
}
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;
}
/**
* @return MethodNode[]
*/
public function getMethods() {
return $this->methods;
}
public function addMethod(MethodNode $method) {
$this->methods[$method
->getName()] = $method;
}
public function removeMethod($name) {
unset($this->methods[$name]);
}
/**
* @param string $name
*
* @return MethodNode|null
*/
public function getMethod($name) {
return $this
->hasMethod($name) ? $this->methods[$name] : null;
}
/**
* @param string $name
*
* @return bool
*/
public function hasMethod($name) {
return isset($this->methods[$name]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ClassNode:: |
private | property | ||
ClassNode:: |
private | property | ||
ClassNode:: |
private | property | ||
ClassNode:: |
private | property | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function | ||
ClassNode:: |
public | function |