src/Behat/Gherkin/Gherkin.php
public function load($resource, array $filters = array())
    {
        $filters = array_merge($this->filters, $filters);

        $matches = array();
        if (preg_match('/^(.*)\:(\d+)-(\d+|\*)$/', $resource, $matches)) {
            $resource = $matches[1];
            $filters[] = new LineRangeFilter($matches[2], $matches[3]);
        } elseif (preg_match('/^(.*)\:(\d+)$/', $resource, $matches)) {
            $resource = $matches[1];
            $filters[] = new LineFilter($matches[2]);
        }

        $loader = $this->resolveLoader($resource);

        if (null === $loader) {
            return array();
        }

        $features = array();
        foreach ($loader->load($resource) as $feature) {
            foreach ($filters as $filter) {
                $feature = $filter->filterFeature($feature);

                if (!$feature->hasScenarios() && !$filter->isFeatureMatch($feature)) {
                    continue 2;
                }
            }

            $features[] = $feature;
        }

        return $features;
    }
public function load($resource, array $filters = array())
    {
        $filters = array_merge($this->filters, $filters);

        $matches = array();
        if (preg_match('/^(.*)\:(\d+)-(\d+|\*)$/', $resource, $matches)) {
            $resource = $matches[1];
            $filters[] = new LineRangeFilter($matches[2], $matches[3]);
        } elseif (preg_match('/^(.*)\:(\d+)$/', $resource, $matches)) {
            $resource = $matches[1];
            $filters[] = new LineFilter($matches[2]);
        }

        $loader = $this->resolveLoader($resource);

        if (null === $loader) {
            return array();
        }

        $features = array();
        foreach ($loader->load($resource) as $feature) {
            foreach ($filters as $filter) {
                $feature = $filter->filterFeature($feature);

                if (!$feature->hasScenarios() && !$filter->isFeatureMatch($feature)) {
                    continue 2;
                }
            }

            $features[] = $feature;
        }

        return $features;
    }
public function load ( $ resource , array $ filters = array ( ) ) { $ filters = array_merge ( $ this -> filters , $ filters ) ; $ matches = array ( ) ; if ( preg_match ( '/^(.*)\:(\d+)-(\d+|\*)$/' , $ resource , $ matches ) ) { $ resource = $ matches [ 1 ] ; $ filters [ ] = new LineRangeFilter ( $ matches [ 2 ] , $ matches [ 3 ] ) ; } elseif ( preg_match ( '/^(.*)\:(\d+)$/' , $ resource , $ matches ) ) { $ resource = $ matches [ 1 ] ; $ filters [ ] = new LineFilter ( $ matches [ 2 ] ) ; } $ loader = $ this -> resolveLoader ( $ resource ) ; if ( null === $ loader ) { return array ( ) ; } $ features = array ( ) ; foreach ( $ loader -> load ( $ resource ) as $ feature ) { foreach ( $ filters as $ filter ) { $ feature = $ filter -> filterFeature ( $ feature ) ; if ( ! $ feature -> hasScenarios ( ) && ! $ filter -> isFeatureMatch ( $ feature ) ) { continue 2 ; } } $ features [ ] = $ feature ; } return $ features ; }
Loads & filters resource with added loaders.

@param mixed                    $resource Resource to load
@param FeatureFilterInterface[] $filters  Additional filters

@return array
Loads & filters resource with added loaders .