1 | <?php |
||
24 | class Gherkin |
||
25 | { |
||
26 | /** |
||
27 | * @var LoaderInterface[] |
||
28 | */ |
||
29 | protected $loaders = array(); |
||
30 | /** |
||
31 | * @var FeatureFilterInterface[] |
||
32 | */ |
||
33 | protected $filters = array(); |
||
34 | |||
35 | /** |
||
36 | * Adds loader to manager. |
||
37 | * |
||
38 | * @param LoaderInterface $loader Feature loader |
||
39 | */ |
||
40 | 4 | public function addLoader(LoaderInterface $loader) |
|
41 | { |
||
42 | 4 | $this->loaders[] = $loader; |
|
43 | 4 | } |
|
44 | |||
45 | /** |
||
46 | * Adds filter to manager. |
||
47 | * |
||
48 | * @param FeatureFilterInterface $filter Feature filter |
||
49 | */ |
||
50 | 3 | public function addFilter(FeatureFilterInterface $filter) |
|
51 | { |
||
52 | 3 | $this->filters[] = $filter; |
|
53 | 3 | } |
|
54 | |||
55 | /** |
||
56 | * Sets filters to the parser. |
||
57 | * |
||
58 | * @param FeatureFilterInterface[] $filters |
||
59 | */ |
||
60 | 1 | public function setFilters(array $filters) |
|
65 | |||
66 | /** |
||
67 | * Sets base features path. |
||
68 | * |
||
69 | * @param string $path Loaders base path |
||
70 | */ |
||
71 | 1 | public function setBasePath($path) |
|
79 | |||
80 | /** |
||
81 | * Loads & filters resource with added loaders. |
||
82 | * |
||
83 | * @param mixed $resource Resource to load |
||
84 | * @param FeatureFilterInterface[] $filters Additional filters |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | 4 | public function load($resource, array $filters = array()) |
|
122 | |||
123 | /** |
||
124 | * Resolves loader by resource. |
||
125 | * |
||
126 | * @param mixed $resource Resource to load |
||
127 | * |
||
128 | * @return LoaderInterface |
||
129 | */ |
||
130 | 4 | public function resolveLoader($resource) |
|
140 | } |
||
141 |