phplrt/phplrt

View on GitHub
libs/compiler/src/Node/Statement/RepetitionNode.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace Phplrt\Compiler\Node\Statement;

/**
 * @internal This is an internal class, please do not use it in your application code.
 * @psalm-internal Phplrt\Compiler
 * @psalm-suppress PropertyNotSetInConstructor
 */
class RepetitionNode extends Statement
{
    public function __construct(
        public Statement $statement,
        public RepetitionQuantifierNode $quantifier,
    ) {}

    /**
     * @return \Traversable<non-empty-string, Statement|RepetitionQuantifierNode>
     */
    public function getIterator(): \Traversable
    {
        yield 'statement' => $this->statement;
        yield 'quantifier' => $this->quantifier;
    }
}