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;
}