4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Behat\Context\Snippet\Generator;
14 * Uses multiple child identifiers - the first one that returns non-null result would
17 final class AggregatePatternIdentifier implements PatternIdentifier
20 * @var PatternIdentifier[]
25 * Initialises identifier.
27 * @param PatternIdentifier[] $identifiers
29 public function __construct(array $identifiers)
31 $this->identifiers = $identifiers;
37 public function guessPatternType($contextClass)
39 foreach ($this->identifiers as $identifier) {
40 $pattern = $identifier->guessPatternType($contextClass);
42 if (null !== $pattern) {