src/Behat/Behat/Gherkin/ServiceContainer/GherkinExtension.php
private function createFilterDefinition($type, $filterString)
    {
        if ('role' === $type) {
            return new Definition('Behat\Gherkin\Filter\RoleFilter', array($filterString));
        }

        if ('name' === $type) {
            return new Definition('Behat\Gherkin\Filter\NameFilter', array($filterString));
        }

        if ('tags' === $type) {
            return new Definition('Behat\Gherkin\Filter\TagFilter', array($filterString));
        }

        if ('narrative' === $type) {
            return new Definition('Behat\Gherkin\Filter\NarrativeFilter', array($filterString));
        }

        throw new ExtensionException(sprintf(
            '`%s` filter is not supported by the `filters` option of gherkin extension. Supported types are `%s`.',
            $type,
            implode('`, `', array('narrative', 'role', 'name', 'tags'))
        ), 'gherkin');
    }
private function createFilterDefinition($type, $filterString)
    {
        if ('role' === $type) {
            return new Definition('Behat\Gherkin\Filter\RoleFilter', array($filterString));
        }

        if ('name' === $type) {
            return new Definition('Behat\Gherkin\Filter\NameFilter', array($filterString));
        }

        if ('tags' === $type) {
            return new Definition('Behat\Gherkin\Filter\TagFilter', array($filterString));
        }

        if ('narrative' === $type) {
            return new Definition('Behat\Gherkin\Filter\NarrativeFilter', array($filterString));
        }

        throw new ExtensionException(sprintf(
            '`%s` filter is not supported by the `filters` option of gherkin extension. Supported types are `%s`.',
            $type,
            implode('`, `', array('narrative', 'role', 'name', 'tags'))
        ), 'gherkin');
    }
private function createFilterDefinition ( $ type , $ filterString ) { if ( 'role' === $ type ) { return new Definition ( 'Behat\Gherkin\Filter\RoleFilter' , array ( $ filterString ) ) ; } if ( 'name' === $ type ) { return new Definition ( 'Behat\Gherkin\Filter\NameFilter' , array ( $ filterString ) ) ; } if ( 'tags' === $ type ) { return new Definition ( 'Behat\Gherkin\Filter\TagFilter' , array ( $ filterString ) ) ; } if ( 'narrative' === $ type ) { return new Definition ( 'Behat\Gherkin\Filter\NarrativeFilter' , array ( $ filterString ) ) ; } throw new ExtensionException ( sprintf ( '`%s` filter is not supported by the `filters` option of gherkin extension. Supported types are `%s`.' , $ type , implode ( '`, `' , array ( 'narrative' , 'role' , 'name' , 'tags' ) ) ) , 'gherkin' ) ; }
Creates filter definition of provided type.

@param string $type
@param string $filterString

@return Definition

@throws ExtensionException If filter type is not recognised
Creates filter definition of provided type .