| 1 | <?php |
||
| 12 | class Visibility |
||
| 13 | { |
||
| 14 | public const VISIBILITY_PUBLIC = 'public'; |
||
| 15 | public const VISIBILITY_PROTECTED = 'protected'; |
||
| 16 | public const VISIBILITY_PRIVATE = 'private'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $visibility; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * |
||
| 25 | * @param string $visibility |
||
| 26 | */ |
||
| 27 | 8 | public function __construct(string $visibility) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @param Flag $flag |
||
| 35 | * |
||
| 36 | * @return Visibility |
||
| 37 | */ |
||
| 38 | 3 | public static function fromFlag(Flag $flag): Visibility |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | 6 | public function visibility(): string |
|
| 58 | |||
| 59 | /** |
||
| 60 | * @param string $visibility |
||
| 61 | * |
||
| 62 | * @throws InvalidArgumentException |
||
| 63 | */ |
||
| 64 | 8 | protected function validate(string $visibility): void |
|
| 70 | } |
||
| 71 |