1 | <?php |
||
22 | final class Visibility |
||
23 | { |
||
24 | /** |
||
25 | * constant for protected visibility |
||
26 | */ |
||
27 | const PUBLIC_ = 'public'; |
||
28 | |||
29 | /** |
||
30 | * constant for protected visibility |
||
31 | */ |
||
32 | const PROTECTED_ = 'protected'; |
||
33 | |||
34 | /** |
||
35 | * constant for private visibility |
||
36 | */ |
||
37 | const PRIVATE_ = 'private'; |
||
38 | |||
39 | /** |
||
40 | * @var string value can be public, protected or private |
||
41 | */ |
||
42 | private $visibility; |
||
43 | |||
44 | /** |
||
45 | * Initializes the object. |
||
46 | * |
||
47 | * @throws InvalidArgumentException when visibility does not match public|protected|private |
||
48 | */ |
||
49 | 5 | public function __construct(string $visibility) |
|
61 | |||
62 | /** |
||
63 | * Will return a string representation of visibility. |
||
64 | */ |
||
65 | 4 | public function __toString(): string |
|
69 | } |
||
70 |