4 * This file is part of the Behat Gherkin.
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\Gherkin\Filter;
13 use Behat\Gherkin\Node\FeatureNode;
16 * Abstract filter class.
18 * @author Konstantin Kudryashov <ever.zet@gmail.com>
20 abstract class ComplexFilter implements ComplexFilterInterface
23 * Filters feature according to the filter.
25 * @param FeatureNode $feature
29 public function filterFeature(FeatureNode $feature)
32 foreach ($feature->getScenarios() as $scenario) {
33 if (!$this->isScenarioMatch($feature, $scenario)) {
37 $scenarios[] = $scenario;
40 return new FeatureNode(
42 $feature->getDescription(),
44 $feature->getBackground(),
46 $feature->getKeyword(),
47 $feature->getLanguage(),