Property.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * @property int $type Modifiers
  4. * @property PHPParser_Node_Stmt_PropertyProperty[] $props Properties
  5. */
  6. class PHPParser_Node_Stmt_Property extends PHPParser_Node_Stmt
  7. {
  8. /**
  9. * Constructs a class property list node.
  10. *
  11. * @param int $type Modifiers
  12. * @param PHPParser_Node_Stmt_PropertyProperty[] $props Properties
  13. * @param array $attributes Additional attributes
  14. */
  15. public function __construct($type, array $props, array $attributes = array()) {
  16. parent::__construct(
  17. array(
  18. 'type' => $type,
  19. 'props' => $props,
  20. ),
  21. $attributes
  22. );
  23. }
  24. public function isPublic() {
  25. return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC);
  26. }
  27. public function isProtected() {
  28. return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED);
  29. }
  30. public function isPrivate() {
  31. return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PRIVATE);
  32. }
  33. public function isStatic() {
  34. return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_STATIC);
  35. }
  36. }