| 1 | <?php |
||
| 9 | class BladeX |
||
| 10 | { |
||
| 11 | /** @var array */ |
||
| 12 | public $registeredComponents = []; |
||
| 13 | |||
| 14 | public function component(string $componentName, string $classOrView) |
||
| 24 | |||
| 25 | public function components(string $directory) |
||
| 33 | |||
| 34 | protected function getComponent(string $classOrView): ?object |
||
| 46 | |||
| 47 | public function compile(string $view): string |
||
| 66 | } |
||
| 67 |
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: