1 | <?php |
||
33 | abstract class AbstractPhpMember extends AbstractModel implements DocblockInterface { |
||
34 | |||
35 | use DocblockPart; |
||
36 | use LongDescriptionPart; |
||
37 | use NamePart; |
||
38 | use TypePart; |
||
39 | |||
40 | /** |
||
41 | * Private visibility |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | const VISIBILITY_PRIVATE = 'private'; |
||
46 | |||
47 | /** |
||
48 | * Protected visibility |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | const VISIBILITY_PROTECTED = 'protected'; |
||
53 | |||
54 | /** |
||
55 | * Public visibility |
||
56 | * |
||
57 | * @var string |
||
58 | */ |
||
59 | const VISIBILITY_PUBLIC = 'public'; |
||
60 | |||
61 | /** @var bool */ |
||
62 | private $static = false; |
||
63 | |||
64 | /** @var string */ |
||
65 | private $visibility = self::VISIBILITY_PUBLIC; |
||
66 | |||
67 | /** @var AbstractPhpStruct */ |
||
68 | private $parent; |
||
69 | |||
70 | /** |
||
71 | * Creates a new member |
||
72 | * |
||
73 | * @param string $name the name of the member |
||
74 | */ |
||
75 | 52 | public function __construct(string $name) { |
|
79 | |||
80 | /** |
||
81 | * Sets the members visibility |
||
82 | * |
||
83 | * @see self::VISIBILITY_PUBLIC |
||
84 | * @see self::VISIBILITY_PROTECTED |
||
85 | * @see self::VISIBILITY_PRIVATE |
||
86 | * @param string $visibility the new visibility |
||
87 | * @return $this |
||
88 | */ |
||
89 | 17 | public function setVisibility(string $visibility) { |
|
100 | |||
101 | /** |
||
102 | * Returns the visibility state of this member |
||
103 | * |
||
104 | * @return string the visibility |
||
105 | */ |
||
106 | 19 | public function getVisibility(): string { |
|
109 | |||
110 | /** |
||
111 | * Sets whether or not this member is static |
||
112 | * |
||
113 | * @param bool $static |
||
114 | * @return $this |
||
115 | */ |
||
116 | 13 | public function setStatic(bool $static) { |
|
121 | |||
122 | /** |
||
123 | * Returns whether this member is static |
||
124 | * |
||
125 | * @return bool `true` if static and `false` if not |
||
126 | */ |
||
127 | 18 | public function isStatic(): bool { |
|
130 | |||
131 | /** |
||
132 | * Sets the parent structure to which this member belongs |
||
133 | * |
||
134 | * @internal |
||
135 | * @param AbstractPhpStruct|null $parent |
||
136 | * @return $this |
||
137 | */ |
||
138 | 16 | public function setParent(?AbstractPhpStruct $parent) { |
|
142 | |||
143 | /** |
||
144 | * Returns the parent structure to which this member belongs |
||
145 | * |
||
146 | * @internal |
||
147 | * @return AbstractPhpStruct |
||
148 | */ |
||
149 | 12 | public function getParent(): ?AbstractPhpStruct { |
|
152 | } |
||
153 |