Chris@13: flags = $flags; Chris@0: $this->props = $props; Chris@17: $this->type = \is_string($type) ? new Identifier($type) : $type; Chris@0: } Chris@0: Chris@13: public function getSubNodeNames() : array { Chris@17: return ['flags', 'type', 'props']; Chris@0: } Chris@0: Chris@13: /** Chris@13: * Whether the property is explicitly or implicitly public. Chris@13: * Chris@13: * @return bool Chris@13: */ Chris@13: public function isPublic() : bool { Chris@0: return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 Chris@0: || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; Chris@0: } Chris@0: Chris@13: /** Chris@13: * Whether the property is protected. Chris@13: * Chris@13: * @return bool Chris@13: */ Chris@13: public function isProtected() : bool { Chris@0: return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); Chris@0: } Chris@0: Chris@13: /** Chris@13: * Whether the property is private. Chris@13: * Chris@13: * @return bool Chris@13: */ Chris@13: public function isPrivate() : bool { Chris@0: return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); Chris@0: } Chris@0: Chris@13: /** Chris@13: * Whether the property is static. Chris@13: * Chris@13: * @return bool Chris@13: */ Chris@13: public function isStatic() : bool { Chris@0: return (bool) ($this->flags & Class_::MODIFIER_STATIC); Chris@0: } Chris@17: Chris@13: public function getType() : string { Chris@13: return 'Stmt_Property'; Chris@13: } Chris@0: }