@@ -31,11 +31,11 @@ class Gherkin
3131 public const VERSION = '4.8.0 ' ;
3232
3333 /**
34- * @var LoaderInterface[]
34+ * @var list< LoaderInterface>
3535 */
3636 protected $ loaders = [];
3737 /**
38- * @var FeatureFilterInterface[]
38+ * @var list< FeatureFilterInterface>
3939 */
4040 protected $ filters = [];
4141
@@ -62,12 +62,12 @@ public function addFilter(FeatureFilterInterface $filter)
6262 /**
6363 * Sets filters to the parser.
6464 *
65- * @param FeatureFilterInterface[] $filters
65+ * @param array<array-key, FeatureFilterInterface> $filters
6666 */
6767 public function setFilters (array $ filters )
6868 {
6969 $ this ->filters = [];
70- array_map ([ $ this , ' addFilter ' ] , $ filters );
70+ array_map ($ this -> addFilter (...) , $ filters );
7171 }
7272
7373 /**
@@ -88,7 +88,7 @@ public function setBasePath($path)
8888 * Loads & filters resource with added loaders.
8989 *
9090 * @param mixed $resource Resource to load
91- * @param FeatureFilterInterface[] $filters Additional filters
91+ * @param array<array-key, FeatureFilterInterface> $filters Additional filters
9292 *
9393 * @return array
9494 */
@@ -97,10 +97,10 @@ public function load($resource, array $filters = [])
9797 $ filters = array_merge ($ this ->filters , $ filters );
9898
9999 $ matches = [];
100- if (preg_match ('/^(.*)\ :(\d+)-(\d+|\*)$/ ' , $ resource , $ matches )) {
100+ if (preg_match ('/^(.*):(\d+)-(\d+|\*)$/ ' , $ resource , $ matches )) {
101101 $ resource = $ matches [1 ];
102102 $ filters [] = new LineRangeFilter ($ matches [2 ], $ matches [3 ]);
103- } elseif (preg_match ('/^(.*)\ :(\d+)$/ ' , $ resource , $ matches )) {
103+ } elseif (preg_match ('/^(.*):(\d+)$/ ' , $ resource , $ matches )) {
104104 $ resource = $ matches [1 ];
105105 $ filters [] = new LineFilter ($ matches [2 ]);
106106 }
@@ -132,7 +132,7 @@ public function load($resource, array $filters = [])
132132 *
133133 * @param mixed $resource Resource to load
134134 *
135- * @return LoaderInterface
135+ * @return LoaderInterface|null
136136 */
137137 public function resolveLoader ($ resource )
138138 {
0 commit comments