1 | <?php |
||
7 | class Property |
||
8 | { |
||
9 | const BLOCK = 'block'; |
||
10 | const GENERAL_CATEGORY = 'gc'; |
||
11 | const SCRIPT = 'script'; |
||
12 | |||
13 | /** |
||
14 | * @var bool[] |
||
15 | */ |
||
16 | private static $valid = [ |
||
17 | self::BLOCK => true, |
||
18 | self::GENERAL_CATEGORY => true, |
||
19 | self::SCRIPT => true |
||
20 | ]; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $type; |
||
26 | |||
27 | /** |
||
28 | * @param string $type |
||
29 | * @throws InvalidArgumentException |
||
30 | */ |
||
31 | private function __construct($type) |
||
39 | |||
40 | /** |
||
41 | * @param string $type |
||
42 | * @return bool |
||
43 | */ |
||
44 | private function isKnownType($type) |
||
49 | |||
50 | /** |
||
51 | * @param string $type |
||
52 | * @return Property |
||
53 | */ |
||
54 | public static function ofType($type) |
||
58 | |||
59 | /** |
||
60 | * @return string |
||
61 | */ |
||
62 | public function __toString() |
||
66 | } |
||
67 |