| Conditions | 1 |
| Paths | 1 |
| Total Lines | 7 |
| Lines | 7 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | View Code Duplication | public function rules() |
|
| 26 | { |
||
| 27 | return [ |
||
| 28 | 'name' => ['required', 'string', 'min:3', 'unique:roles'], |
||
| 29 | 'display_name' => ['required', 'string', 'min:3'], |
||
| 30 | ]; |
||
| 31 | } |
||
| 32 | |||
| 43 |
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: