1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract\Core;
4:
5: use ArrayAccess;
6: use ReturnTypeWillChange;
7:
8: /**
9: * Provides a standard interface to an underlying object or array and its values
10: *
11: * @api
12: *
13: * @extends ArrayAccess<array-key,mixed>
14: */
15: interface GraphInterface extends ArrayAccess
16: {
17: /**
18: * @param mixed[]|object $value
19: */
20: public function __construct(&$value = []);
21:
22: /**
23: * Get the underlying object or array
24: *
25: * @return mixed[]|object
26: */
27: public function getValue();
28:
29: /**
30: * Get the properties or keys traversed to reach the current value
31: *
32: * @return array<array-key>
33: */
34: public function getPath(): array;
35:
36: /**
37: * Get the value at the given offset
38: *
39: * If the value is an object or array, a new instance of the class is
40: * returned to service it, otherwise the value itself is returned.
41: *
42: * @return static|resource|int|float|string|bool|null
43: * @disregard P1038
44: */
45: #[ReturnTypeWillChange]
46: public function offsetGet($offset);
47: }
48: