1 | <?php |
||
12 | class WelcomeController extends Controller |
||
13 | { |
||
14 | /* |
||
15 | |-------------------------------------------------------------------------- |
||
16 | | Welcome Controller |
||
17 | |-------------------------------------------------------------------------- |
||
18 | | |
||
19 | | This controller renders the "marketing page" for the application and |
||
20 | | is configured to only allow guests. Like most of the other sample |
||
21 | | controllers, you are free to modify or remove it as you desire. |
||
22 | | |
||
23 | */ |
||
24 | |||
25 | /** |
||
26 | * Create a new controller instance. |
||
27 | */ |
||
28 | 1 | public function __construct() |
|
32 | |||
33 | /** |
||
34 | * Show the application welcome screen to the user. |
||
35 | * |
||
36 | * @return Response |
||
37 | */ |
||
38 | 1 | public function index() |
|
44 | |||
45 | /** |
||
46 | * Show the getting started screen to the user. |
||
47 | * |
||
48 | * @param MarkdownParser $markdown |
||
49 | * @param Cache $cache |
||
50 | * @param Filesystem $file |
||
51 | * |
||
52 | * @return Response |
||
53 | */ |
||
54 | public function gettingStarted(MarkdownParser $markdown, Cache $cache, Filesystem $file) |
||
64 | |||
65 | /** |
||
66 | * Show the statistics screen to the user. |
||
67 | * |
||
68 | * @return Response |
||
69 | */ |
||
70 | 1 | public function statistics(Statistics $statistics) |
|
84 | } |
||
85 |
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: