| 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 |
namespace WindPressDeps\Symfony\Component\PropertyAccess; |
| 12 |
|
| 13 |
/** |
| 14 |
* A sequence of property names or array indices. |
| 15 |
* |
| 16 |
* @author Bernhard Schussek <bschussek@gmail.com> |
| 17 |
* |
| 18 |
* @extends \Traversable<int, string> |
| 19 |
*/ |
| 20 |
interface PropertyPathInterface extends \Traversable |
| 21 |
{ |
| 22 |
/** |
| 23 |
* Returns the string representation of the property path. |
| 24 |
* |
| 25 |
* @return string |
| 26 |
*/ |
| 27 |
public function __toString(); |
| 28 |
/** |
| 29 |
* Returns the length of the property path, i.e. the number of elements. |
| 30 |
* |
| 31 |
* @return int |
| 32 |
*/ |
| 33 |
public function getLength(); |
| 34 |
/** |
| 35 |
* Returns the parent property path. |
| 36 |
* |
| 37 |
* The parent property path is the one that contains the same items as |
| 38 |
* this one except for the last one. |
| 39 |
* |
| 40 |
* If this property path only contains one item, null is returned. |
| 41 |
* |
| 42 |
* @return self|null |
| 43 |
*/ |
| 44 |
public function getParent(); |
| 45 |
/** |
| 46 |
* Returns the elements of the property path as array. |
| 47 |
* |
| 48 |
* @return list<string> |
| 49 |
*/ |
| 50 |
public function getElements(); |
| 51 |
/** |
| 52 |
* Returns the element at the given index in the property path. |
| 53 |
* |
| 54 |
* @param int $index The index key |
| 55 |
* |
| 56 |
* @return string |
| 57 |
* |
| 58 |
* @throws Exception\OutOfBoundsException If the offset is invalid |
| 59 |
*/ |
| 60 |
public function getElement(int $index); |
| 61 |
/** |
| 62 |
* Returns whether the element at the given index is a property. |
| 63 |
* |
| 64 |
* @param int $index The index in the property path |
| 65 |
* |
| 66 |
* @return bool |
| 67 |
* |
| 68 |
* @throws Exception\OutOfBoundsException If the offset is invalid |
| 69 |
*/ |
| 70 |
public function isProperty(int $index); |
| 71 |
/** |
| 72 |
* Returns whether the element at the given index is an array index. |
| 73 |
* |
| 74 |
* @param int $index The index in the property path |
| 75 |
* |
| 76 |
* @return bool |
| 77 |
* |
| 78 |
* @throws Exception\OutOfBoundsException If the offset is invalid |
| 79 |
*/ |
| 80 |
public function isIndex(int $index); |
| 81 |
} |
| 82 |
|