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 SimpleFilter implements FilterInterface
23 * Filters feature according to the filter.
25 * @param FeatureNode $feature
29 public function filterFeature(FeatureNode $feature)
31 if ($this->isFeatureMatch($feature)) {
36 foreach ($feature->getScenarios() as $scenario) {
37 if (!$this->isScenarioMatch($scenario)) {
41 $scenarios[] = $scenario;
44 return new FeatureNode(
46 $feature->getDescription(),
48 $feature->getBackground(),
50 $feature->getKeyword(),
51 $feature->getLanguage(),