1 | <?php |
||
9 | abstract class BaseCacheProfile implements CacheProfile |
||
10 | { |
||
11 | public function enabled(Request $request): bool |
||
15 | |||
16 | /* |
||
17 | * Return the time when the cache must be invalided. |
||
18 | */ |
||
19 | public function cacheRequestUntil(Request $request): DateTime |
||
25 | |||
26 | /* |
||
27 | * Set a string to add to differentiate this request from others. |
||
28 | */ |
||
29 | public function cacheNameSuffix(Request $request): string |
||
37 | |||
38 | public function isRunningInConsole(): bool |
||
46 | } |
||
47 |
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: