| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function getView() |
||
| 38 | { |
||
| 39 | if (view()->exists($this->view)) { |
||
|
|
|||
| 40 | return $this->view; |
||
| 41 | } |
||
| 42 | |||
| 43 | if (view()->exists('admin.'.$this->urlPrefix().'.index')) { |
||
| 44 | return 'admin.'.$this->urlPrefix().'.index'; |
||
| 45 | } |
||
| 46 | |||
| 47 | if (view()->exists('admin.'.$this->urlPrefix())) { |
||
| 48 | return 'admin.'.$this->urlPrefix(); |
||
| 49 | } |
||
| 50 | |||
| 51 | if (view()->exists('flare::'.$this->view)) { |
||
| 52 | return 'flare::'.$this->view; |
||
| 53 | } |
||
| 54 | |||
| 55 | return parent::getView(); |
||
| 56 | } |
||
| 57 | } |
||
| 58 |
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: