Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function routesProvider() : array |
||
39 | { |
||
40 | return [ |
||
41 | 'empty' => [ |
||
42 | [], |
||
43 | '/', |
||
44 | false, |
||
45 | ], |
||
46 | 'request one' => [ |
||
47 | ['#/#'], |
||
48 | '/', |
||
49 | true, |
||
50 | ], |
||
51 | 'many routes' => [ |
||
52 | ['#^/foo$#', '#^/bar$#'], |
||
53 | '/bar', |
||
54 | true, |
||
55 | ], |
||
56 | 'many routes' => [ |
||
57 | ['#^/foo$#', '#^/bar$#'], |
||
58 | '/baz', |
||
59 | false, |
||
60 | ], |
||
61 | ]; |
||
62 | } |
||
63 | } |
||
64 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: