rfc:property_write_visibility
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:property_write_visibility [2020/06/29 17:00] – andrerom | rfc:property_write_visibility [2020/07/02 20:30] – Add missing phpdoc to "before" example andrerom | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Property write/set visibility ====== | ====== PHP RFC: Property write/set visibility ====== | ||
- | * Version: 0.4.5 | + | * Version: 0.4.6 |
* Date: 2020-06-29 | * Date: 2020-06-29 | ||
* Author: André Rømcke < | * Author: André Rømcke < | ||
Line 18: | Line 18: | ||
<code php> | <code php> | ||
+ | /** | ||
+ | * @property-read int $id | ||
+ | * @property-read string $name | ||
+ | */ | ||
class User { | class User { | ||
private int $id; | private int $id; | ||
Line 137: | Line 141: | ||
| | ||
// Property is write-only in public and protected scope | // Property is write-only in public and protected scope | ||
- | private: | + | private: |
public function __construct(int $id, string $name) { | public function __construct(int $id, string $name) { | ||
Line 161: | Line 165: | ||
| | ||
// Property is write-only in public and protected scope | // Property is write-only in public and protected scope | ||
- | private public(set) string $newName; | + | private public(set) string $newPassword; |
public function __construct(int $id, string $name) { | public function __construct(int $id, string $name) { |
rfc/property_write_visibility.txt · Last modified: 2020/07/07 07:33 by andrerom