1 | <?php |
||
8 | class SnippetsController extends Controller |
||
9 | { |
||
10 | public function __construct() |
||
14 | |||
15 | /** |
||
16 | * List all of the snippets. |
||
17 | * |
||
18 | * @return \Response |
||
19 | */ |
||
20 | public function index() |
||
34 | |||
35 | /** |
||
36 | * Show a page to create a new snippet. |
||
37 | * |
||
38 | * @param Snippet $snippet |
||
39 | * @return \Response |
||
40 | */ |
||
41 | public function create(Snippet $snippet) |
||
45 | |||
46 | /** |
||
47 | * Show a single snippet. |
||
48 | * |
||
49 | * @param Snippet $snippet |
||
50 | * @return \Response |
||
51 | */ |
||
52 | public function show(Snippet $snippet) |
||
58 | |||
59 | /** |
||
60 | * Store a new snippet in the database. |
||
61 | * |
||
62 | * @return \RedirectResponse |
||
63 | */ |
||
64 | public function store() |
||
78 | } |
||
79 |
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: