Exception
1 year ago
CHANGELOG.md
1 year ago
LICENSE
1 year ago
PropertyAccess.php
4 years ago
PropertyAccessor.php
1 year ago
PropertyAccessorBuilder.php
1 year ago
PropertyAccessorInterface.php
1 year ago
PropertyPath.php
1 year ago
PropertyPathBuilder.php
1 year ago
PropertyPathInterface.php
1 year ago
PropertyPathIterator.php
1 year ago
PropertyPathIteratorInterface.php
1 year ago
README.md
4 years ago
composer.json
1 year ago
PropertyPathInterface.php
89 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 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 <bschussek@gmail.com> |
| 18 | * |
| 19 | * @extends \Traversable<int, string> |
| 20 | */ |
| 21 | interface PropertyPathInterface extends \Traversable |
| 22 | { |
| 23 | /** |
| 24 | * Returns the string representation of the property path. |
| 25 | * |
| 26 | * @return string |
| 27 | */ |
| 28 | public function __toString(); |
| 29 | |
| 30 | /** |
| 31 | * Returns the length of the property path, i.e. the number of elements. |
| 32 | * |
| 33 | * @return int |
| 34 | */ |
| 35 | public function getLength(); |
| 36 | |
| 37 | /** |
| 38 | * Returns the parent property path. |
| 39 | * |
| 40 | * The parent property path is the one that contains the same items as |
| 41 | * this one except for the last one. |
| 42 | * |
| 43 | * If this property path only contains one item, null is returned. |
| 44 | * |
| 45 | * @return self|null |
| 46 | */ |
| 47 | public function getParent(); |
| 48 | |
| 49 | /** |
| 50 | * Returns the elements of the property path as array. |
| 51 | * |
| 52 | * @return list<string> |
| 53 | */ |
| 54 | public function getElements(); |
| 55 | |
| 56 | /** |
| 57 | * Returns the element at the given index in the property path. |
| 58 | * |
| 59 | * @param int $index The index key |
| 60 | * |
| 61 | * @return string |
| 62 | * |
| 63 | * @throws Exception\OutOfBoundsException If the offset is invalid |
| 64 | */ |
| 65 | public function getElement(int $index); |
| 66 | |
| 67 | /** |
| 68 | * Returns whether the element at the given index is a property. |
| 69 | * |
| 70 | * @param int $index The index in the property path |
| 71 | * |
| 72 | * @return bool |
| 73 | * |
| 74 | * @throws Exception\OutOfBoundsException If the offset is invalid |
| 75 | */ |
| 76 | public function isProperty(int $index); |
| 77 | |
| 78 | /** |
| 79 | * Returns whether the element at the given index is an array index. |
| 80 | * |
| 81 | * @param int $index The index in the property path |
| 82 | * |
| 83 | * @return bool |
| 84 | * |
| 85 | * @throws Exception\OutOfBoundsException If the offset is invalid |
| 86 | */ |
| 87 | public function isIndex(int $index); |
| 88 | } |
| 89 |