Debian Codegraph @

lib/3rdParty/composer/symfony/property-access/PropertyPathInterface.php

raw symbols SCIP
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\PropertyAccess;
13
14 /**
15 * A sequence of property names or array indices.
16 *
17 * @author Bernhard Schussek <[email protected]>
18 *
19 * @extends \Traversable<int, string>
20 */
21 interface PropertyPathInterface extends \Traversable, \Stringable
22 {
23 /**
24 * Returns the string representation of the property path.
25 */
26 public function __toString(): string;
27
28 /**
29 * Returns the length of the property path, i.e. the number of elements.
30 */
31 public function getLength(): int;
32
33 /**
34 * Returns the parent property path.
35 *
36 * The parent property path is the one that contains the same items as
37 * this one except for the last one.
38 *
39 * If this property path only contains one item, null is returned.
40 */
41 public function getParent(): ?self;
42
43 /**
44 * Returns the elements of the property path as array.
45 *
46 * @return list<string>
47 */
48 public function getElements(): array;
49
50 /**
51 * Returns the element at the given index in the property path.
52 *
53 * @param int $index The index key
54 *
55 * @throws Exception\OutOfBoundsException If the offset is invalid
56 */
57 public function getElement(int $index): string;
58
59 /**
60 * Returns whether the element at the given index is a property.
61 *
62 * @param int $index The index in the property path
63 *
64 * @throws Exception\OutOfBoundsException If the offset is invalid
65 */
66 public function isProperty(int $index): bool;
67
68 /**
69 * Returns whether the element at the given index is an array index.
70 *
71 * @param int $index The index in the property path
72 *
73 * @throws Exception\OutOfBoundsException If the offset is invalid
74 */
75 public function isIndex(int $index): bool;
76
77 /**
78 * Returns whether the element at the given index is null safe.
79 */
80 public function isNullSafe(int $index): bool;
81 }