Debian Codegraph @

lib/3rdParty/composer/symfony/property-access/PropertyPathIterator.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 * Traverses a property path and provides additional methods to find out
16 * information about the current element.
17 *
18 * @author Bernhard Schussek <[email protected]>
19 *
20 * @extends \ArrayIterator<int, string>
21 */
22 class PropertyPathIterator extends \ArrayIterator implements PropertyPathIteratorInterface
23 {
24 public function __construct(
25 protected PropertyPathInterface $path,
26 ) {
27 parent::__construct($path->getElements());
28 }
29
30 public function isIndex(): bool
31 {
32 return $this->path->isIndex($this->key());
33 }
34
35 public function isProperty(): bool
36 {
37 return $this->path->isProperty($this->key());
38 }
39 }