1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Core; |
4: | |
5: | /** |
6: | * Reads and writes arbitrary undeclared properties |
7: | */ |
8: | interface Extensible |
9: | { |
10: | /** |
11: | * Set the value of an undeclared property |
12: | * |
13: | * @param mixed $value |
14: | */ |
15: | public function setMetaProperty(string $name, $value): void; |
16: | |
17: | /** |
18: | * Get the value of an undeclared property |
19: | * |
20: | * @return mixed `null` if the undeclared property is not set. |
21: | */ |
22: | public function getMetaProperty(string $name); |
23: | |
24: | /** |
25: | * True if an undeclared property is set |
26: | */ |
27: | public function isMetaPropertySet(string $name): bool; |
28: | |
29: | /** |
30: | * Unset an undeclared property |
31: | */ |
32: | public function unsetMetaProperty(string $name): void; |
33: | |
34: | /** |
35: | * Get an array that maps the object's undeclared property names to their |
36: | * current values |
37: | * |
38: | * @return array<string,mixed> |
39: | */ |
40: | public function getMetaProperties(): array; |
41: | |
42: | /** |
43: | * Unset the object's undeclared properties |
44: | * |
45: | * @return $this |
46: | */ |
47: | public function clearMetaProperties(); |
48: | |
49: | /** |
50: | * Set the value of an undeclared property |
51: | * |
52: | * @param mixed $value |
53: | */ |
54: | public function __set(string $name, $value): void; |
55: | |
56: | /** |
57: | * Get the value of an undeclared property |
58: | * |
59: | * @return mixed `null` if the undeclared property is not set. |
60: | */ |
61: | public function __get(string $name); |
62: | |
63: | /** |
64: | * True if an undeclared property is set |
65: | */ |
66: | public function __isset(string $name): bool; |
67: | |
68: | /** |
69: | * Unset an undeclared property |
70: | */ |
71: | public function __unset(string $name): void; |
72: | } |
73: |